In my Android Application it's required to give a notification(warning) message before user change Radio Group Selection.
Basically I am trying to give a dialog message (that have warning message and YES/NO buttons to confirm change) when user click any other radio button within that Radio groiup. If user presses YES then to change readio button selection with what user wanted to change, otherwise (if press NO) to select back with what was selected before.
I don't see any option in onCheckedChanged
method when listen to OnCheckedChangeListener
. What would be the best way to do this. Thanks
EDITS
I'm providing the warning message from a Dialog within onCheckedChanged
method with option to Confirm the change (with YES/NO buttons). Problem is when user don't want the new selection after seeing the warning, I need a way to know the prevoiusly selected Radio Button to revert user's new selection.
public void onCheckedChanged(RadioGroup group, int checkedId)
The above method provides "checkedId" but how to know which Radio Button had selected before. It's required when user want to Cancel change..
Can do this by tracking the ealier selection defining a class level variable to hold old Radio button ID or some other logic like that. But there should be a straight forward way in Radio group to cancel new selection (by selecting old one back). I looked for beforeRadioCheckChange Type listener but didn't manage to find