I have a ListPreference and want to verify if there is no selection to make some code/treatement. How can i do this ?
I have this to verify the selection:
if (Integer.valueOf(choice) == 0) {
What code to verify if not selection?
Thank you for your help.
If there is a preference selected for this
ListPreference, then it will be saved in yourSharedPreferences. You can test against this value by doing something like this:You could call this method at any point in your application lifecycle to determine if the preference has been set.