Reputation: 645
I have studied preference activity but I don't understand it. Can anybody tell me what is the use of preference activity? How does it differ from activity?
Thanks
Upvotes: 22
Views: 8898
Reputation: 32270
It gives a very easy way to create a standard looking settings screen for any application.
minimal coding is required
it takes care of UI.The values are stored in SharedPreferences automatically by the PreferenceActivity and so its scope becomes app wide.
Upvotes: 10
Reputation: 1
PreferenceActivity is a class that allows you to implement an activity that realizes a hierarchical organization of choices. Most often it provides a good bases for building the settings activity in you application.
Upvotes: 0
Reputation: 135
such settings screen, you can use it for your app where user want to change setting.
Upvotes: 1
Reputation: 4659
It is usually used to create a settings screen for applications .The values are stored in SharedPreferences automatically as soon as user selects a preference setting. It frees the programmer from explicitly saving preference values.
Upvotes: 0
Reputation: 5408
PreferenceActivity supports the simple handling of preferences. It can show a set of preferences to the user.
An activity on the other hand is a single thing a user can do.
Checkout Section 13 at this link
Upvotes: 0
Reputation: 2871
PreferencesActivity is a way to easily create preference screens such as those in Android itself, just look under Settings
. These can be used inside applications to easily save preferences to SharedPreferences and then easily access these from within your app.
See this page for more information on PreferenceActivity.
An example of a PreferenceActivity showing some preferences:
Upvotes: 17