In this examplewe have used ListPreference to choose the frequency when user should be reminded. In this example used this field to enter the PasswordĢ:CheckBoxPreference allows you to define a boolean value in preference screen.ģ: ListPreference display choices from which user can select one. We have created 3 different categories here.ġ: EditTextPreference is used to define an editable text property. This file defines user interface for setting page. Step1: Create XML resource inside xml folder: In the example I have called from MainActivity using startActivityForResult() method. In the example I have created user_settings.xml file inside xml folder.Ģ: Create a Class which extends PreferenceActivity class, and inflate the created xml using addPreferencesFromResource() method.ģ: Call/Start the PreferenceActivity (created in 2nd steps) from where you want. In this example I have created a Page/Screen with user can save his password, and other choices/details.ġ: Create xml resource for Preference: create an xml file inside xml folder (if xml folder is not there inside res folder, create xml folder inside res folder. We just need to use the class and specify some resources, and it automatically creates GUI for that itself. ![]() ![]() Android provides excellent framework to save and mange the User preferences. It is generally used for saving the setting/preference of User. PreferenceActivity is the base class for an activity to show a hierarchy of preferences
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |