Questions tagged [preferencescreen]

Represents a top-level Preference that is the root of a Preference hierarchy. A PreferenceActivity points to an instance of this class to show the preferences.

Represents a top-level Preference that is the root of a Preference hierarchy. A PreferenceActivity points to an instance of this class to show the preferences. To instantiate this class, use createPreferenceScreen(Context).

This class can appear in two places:

  • When a PreferenceActivity points to this, it is used as the root and is not shown (only the contained preferences are shown).
  • When it appears inside another preference hierarchy, it is shown and serves as the gateway to another screen of preferences (either by showing another screen of preferences as a Dialog or via a startActivity(android.content.Intent) from the getIntent()). The children of this PreferenceScreen are NOT shown in the screen that this PreferenceScreen is shown in. Instead, a separate screen will be shown when this preference is clicked.
  • 201 questions
    2
    votes
    0 answers

    How to set a Preference icon only when the Preference is shown?

    I have a settings fragment which builds its list of Preference objects dynamically and adds them to the PreferenceScreen object. The list is quite big, roughly 100 items. I want each of the preferences to have an icon. The problem that I am having…
    Jay8ee
    • 101
    • 1
    • 8
    2
    votes
    1 answer

    Android - ListPreference dialog has no padding or margins

    I have set up a ListPreference with a key, title and entries, etc. It looks like this in XML:
    James Warner
    • 385
    • 2
    • 14
    2
    votes
    2 answers

    Android preferences, customize EditTextPreference

    I am setting up the PreferenceScreen for my Android application. I included a EditTextPreference to specify a remote server. Now I want to provide the user with an option to reset the address to the initial value inside the popup: Basically what I…
    2
    votes
    3 answers

    With android I want to have 2 preferences with the same key

    I have 2 prefs - a song title and the audio state(mute or volume) that I want to store in the same key. This works for the clicks and the only problem I have is resetting the summary on onSharedPreferencesChanged I get errors with…
    Tim Wayne
    • 2,235
    • 3
    • 19
    • 18
    2
    votes
    0 answers

    More ready-to-use dialogs for PreferencesFragment

    The concept of Android's PreferencesFragment is great, but I soon experienced the limitations of this concept, since there are very few dialogs provided. I can't easily achieve user friendly validating dialogs for Entering a number in a certain…
    OneWorld
    • 17,512
    • 21
    • 86
    • 136
    2
    votes
    3 answers

    How to make things done on Preferences being changed?

    I've set up a Preference Screen as a settings option in my App, but I am totally confused about how to make the changes done when user selects or changes an Option. Here's the xml code of my PreferenceScreen:
    Hammad Nasir
    • 153
    • 1
    • 10
    2
    votes
    1 answer

    How to change ListPreference font colors?

    I've made the change to the PreferenceScreen background color to blue, but I can't figure out how to change the font color for ListPreference. I mean the font color on the list. This font color is black in the blue background. Is there a way to…
    2
    votes
    1 answer

    Add font to preferenceScreen title

    I have created nested preferenceScreens.I want to add custom font to preferenceScreen title and summary. I try to use font which loaded to typeface. How can i do this? thanks. here is my preference.xml :
    Kelum Deshapriya
    • 258
    • 4
    • 14
    2
    votes
    1 answer

    Nested Preference Screen closes on Screenorientation change in Android

    I recently stumbled upon a problem. I am working with a Nested PreferenceScreen like this:
    2
    votes
    1 answer

    Android activity restart and Preference screen

    I have an application with a MainActivity and few other activites. From the MainActivity I start a preference screen, where I set theme for my application. MainActivity-> Settings->Choose Theme Currently how it works: I restart the application,…
    quad
    • 872
    • 3
    • 17
    • 37
    2
    votes
    1 answer

    PreferencesActivity - customize style of checbkoxes, radio buttons etc

    Possible Duplicate: Change icons of checked and unchecked for Checkbox for Android customize check box preference Is there any way to customize style of elements in PreferencesActivity? I was only able to change color text, background etc. I want…
    MicNeo
    • 716
    • 3
    • 12
    • 20
    1
    vote
    1 answer

    Hide/remove ListPreference from PreferenceScreen

    How can I remove ListPreference from PreferenceScreen at runtime? Something like setVisibility(Visibility.GONE) on a parent row. public class PreferencesActivity extends PreferenceActivity { protected void…
    Vladimir
    • 1,532
    • 1
    • 13
    • 13
    1
    vote
    1 answer

    Own design preferences screen

    I'm trying make Preference Screen like on below image, was used style for SettingActivity in manifest and layouts for PreferenceCategory title, but i not understand, how can do widgets on screen was white color. And i don't know how can i place…
    Crazy D0G
    • 150
    • 1
    • 7
    1
    vote
    1 answer

    Preference activity inside an Alert Dialog

    Can I inflate PreferenceScreen inside an alert dialog? This is what I've tried: final LayoutInflater factory = LayoutInflater.from(this); final View myDialog = factory.inflate(R.xml.prefScr, null); final Dialog dialog = new…
    PC.
    • 6,870
    • 5
    • 36
    • 71
    1
    vote
    6 answers

    Android EdittextPreference Hint (android:hint)

    I have a preference screen with an EditTextPreference. How to set a hint either in xml like android:hint or in code like setHint(int), setHint(CharSequence hint) on the EditTextPreference like on an EditText field? I assumed that it´s like on the…
    user944351
    • 1,213
    • 2
    • 19
    • 27