Tag: preference
-
Resetting the preferences on first launch of an app
If you want to reset or change preferences of an app at the first start here is an example of code you can put in an event as onCreate of the main activity:
-
Padding and margin in DialogPreference
I implemented a Time Picker in the preference using the code found here where the class TimePreference extends the class DialogPreference but I found a lack of alignment with the other preference items because of a different setting of the margins and/or padding.
-
Preference element in xml and the click event
If you have an EditTextPreference tag in a xml file you can catch the click event implementing OnSharedPreferenceChangeListener but it doesn’t work if you have a Preference tag in the xml file. Consider the following code inside a xml file for the preferences: <Preference android:key=”my_key” android:summary=”my_summary” android:title=”my_title” > </Preference>