Android checkbox listen for click before change
问题 I have a requirement where a checkbox is displayed for a specific setting. When the user taps on the checkbox, I want to display an alert dialog. The checkbox should then only change if the user taps on the confirm button (or similar). My point is that the OnCheckedChanged listener only fires after the checkbox has changed state, whereas I want to listen for the click before it changes state. 回答1: you can use onTouchListener and intercept ACTION_DOWN event for showing alert. on users choice