I have a Switch. It works like this
1. Turn it ON shows you AlertDialog with Download/locate/cancel
options to perform (download)/(locate locally)/(cancel the dialog)
2.Turn it OFF shows you AlertDialog with Yes/No
options to delete the files
Now Assume initially, the Switch state is OFF
. Now if I turn it ON
, Listener will register OnChecked as true. Next, if I press cancel the Dialog, OnChecked will be set to false, since no files were located/downloaded. Now this change is detected by the listener even though it is set programmatically. I need a way to divide Switch
state Changes caused by user and program.
My listener is OnCheckedChangeListener.
I know there are similar questions having solutions online which are either makeshift or incomplete.
EDIT: I edited and changed the complete structure of the question to address my root objective. It shouldn't be a problem since there are no answers by the time of this edit.