I have an EditTextPrefernce in my prefernces fragment. I have set it in XML to be androd:numeric=”integer”. Ok that’s working…but the problem is that the user must insert a value in this preference, he can’t delete everything and click ok, because i will get null value then. I have set in the XML default value to be 10000, and in the preference.getLong method to also return a default 1000 value.
So i think i have to somehow check the edit text when the user presses ok in the dialog. Is this possible? or does anyone have a better solution?
Following is the snippet of the code by which you can achieve what you are looking for,