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
    7
    votes
    1 answer

    How to wrap DrawerLayout around PreferenceActivity in an Android app?

    I am writing an Android app to take advantage of Drawer Layout functionality. I want to have an ability to use Drawer Layout as a navigational tool available throughout the app. To use the Drawer Layout, I am using the following in my activity…
    6
    votes
    1 answer

    PreferenceScreen - - Exception - FLAG_ACTIVITY_NEW_TASK

    I am new at android developing. The project is about implementing an AbstractAccountAuthenticator with an AbstractThreadedSyncAdapter to sync certain data on a server with a content provider. I made everything and both adding accounts and syncing is…
    6
    votes
    1 answer

    Android: How to navigate back from preference subscreen via action bar in xml?

    I have a modern SettingsActivity using PreferenceFragement. I defined its layout completely in XML. In my setting I have a preference subscreen. By clicking on it a new PreferenceScreen is shown. As it seems I can only navigate back to the main…
    kaolick
    • 4,817
    • 5
    • 42
    • 53
    5
    votes
    1 answer

    Is possible to change the summary of EditTextPreference dynamically in Android?

    I set up a preferenceScreen to edit the settings in my application. I would like to insert an EditTextPreference that contains a Title like "set your name" and a summary containing the name entered. Is that possible? thank you in advance!
    fran
    • 515
    • 2
    • 11
    • 22
    5
    votes
    1 answer

    Preference screen is white

    I tried to learn Android and decide to create SettingsActivity. But I got the problem that I cannot see any text at PreferenceScreen. My PreferenceScreen is white in design mode, so I cannot see any text there.
    Mentos
    • 168
    • 12
    5
    votes
    1 answer

    Adjust margin/padding in the 'PreferenceScreen' in Android

    I would like to adjust the default margin/padding values for the 'PreferenceScreen' in Android, I know it's not possible to simply set it in the XML code (layout file) but Android definitely gets these values from somewhere and PROBABLY (I hope) I…
    5
    votes
    2 answers

    Android: PreferenceFragment only showing first preference

    I'm having issues with loading the PreferenceFragment in Android. At this point it's a really basic implementation, that I want to expand later on when it works. The problem is that only the first preference is shown after navigating to the…
    5
    votes
    2 answers

    Android preference icons not centered on devices => Lollipop

    I've added an icon to a ListPreference with android:icon, but on devices with Lollipop or Marshmallow, the icon is placed on the left side of the available space instead of in the center where it is on devices pre-Lollipop, and how it should…
    Arjen de Jong
    • 1,051
    • 1
    • 7
    • 15
    5
    votes
    0 answers

    Android how to get the preferenceScreen of a checkBoxPreference

    I have a preference xml file that at some point of it it looks like this:
    4
    votes
    3 answers

    Custom PreferenceScreen with clickable buttons

    I have created following Custom Preference Screen. I want to add Listener on Button1 and Button2. How should I do it? I am using following code for creating above Preference Screen. DemoPref: import android.app.Activity; import…
    Vivek
    • 4,170
    • 6
    • 36
    • 50
    4
    votes
    2 answers

    Overriding the layout used for a preference in a preferenceActivity/preferenceScreen using theming

    I have a preferenceActivity in my application and I have tried to set the preference style using the following theme: