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
    0
    votes
    0 answers

    How to get variable from PreferenceActivity to MainActivity?

    This question seems dumb, but I just cant figure out how to get the boolean, which is set by a CheckBoxPreference in the SettingsActivity, to my MainActivity. CheckBoxPreference:
    BlazeCodeDev
    • 631
    • 1
    • 7
    • 27
    0
    votes
    1 answer

    AndroidX: howto create preference grouping?

    I used to have a PreferenceActivity in Android but then I wanted to migrate to AndroidX. Now I can't find any solution to have this kind of preference grouping: I have tried: PreferenceCategory (but it doesn't groups preferences into deeper…
    Daniel
    • 2,318
    • 2
    • 22
    • 53
    0
    votes
    0 answers

    I have a gap on top of my preferences fragment, dunno what causes it

    I followed this guide https://developer.android.com/guide/topics/ui/settings to create my preferences page, but when I navigate to my settings page, I get an empty row in my settings fragment just before the preferencescreen items, like in the…
    AlanJ
    • 11
    • 5
    0
    votes
    0 answers

    How to get the values from the toogle in a preference in android (with androidAnnotations)

    The project is using a lot of these androidAnnotations. I have the following XML file (notificationSettings):
    B0r1
    • 400
    • 3
    • 15
    0
    votes
    1 answer

    Adding a Calendar to PreferenceScreen

    I'm using DatePreference.java class to use as a preference in my xml file. The problem is that i get an error: Binary XML file line #496: Error inflating class com.fsck.k9.ui.settings.account.DatePreference note that line 496 is the first line of…
    ZoneMeOut
    • 113
    • 3
    • 8
    0
    votes
    3 answers

    overScrollMode - none in PreferenceScreen

    I have a preference screen, and I'm trying to get rid of the overScroll. I have tried bunch of different things as mentioned in other stackoverflow posts, but couldn't get disable the overScroll glow. Here is what I…
    0
    votes
    1 answer

    How to setCancelable(false) for standard dialog PreferenceFragmentCompat

    I'm using PreferenceFragmentCompat to display and set SharedPreferences. This all works fine. However, I keep getting "W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed." in my logs,…
    TinaFrieda
    • 171
    • 3
    • 15
    0
    votes
    1 answer

    PreferenceScreen in PreferenceFragment closing on ScreenOrientation change

    I got some nested PreferenceScreen in my PreferenceActivity, and under them a series of CheckBoxPreference. Everything is working well but, whenever the device is rotated, the PreferenceActivity returns to the main PreferenceScreen, disregarding…
    0
    votes
    2 answers

    Android: Populate ListPreference with installed applications?

    I am somewhat new to android development, this is my first time trying to provide a list of installed applications in a preference screen. The selected value from this list will later be used to launch an app of the user's choosing. I have created…
    0
    votes
    1 answer

    Is there a way to change preference screen text-size without creating a new layout?

    The only way i've found is to a) use text-scaleX in styles, which I like but it stretches the text or b) Make a new layout and change text-size there but I don't like that solution cause that requires having to redo colors and you can't use…
    CrimzonWeb
    • 171
    • 3
    • 15
    0
    votes
    0 answers

    Start activity from PreferenceScreen

    I'm trying to start an activity from a PreferenceScreen. I can see, using the debugger, that the onCreate method of the Activity gets called but unfortunately nothing is shown. Here is my code.
    Antonio La Marra
    • 5,949
    • 4
    • 15
    • 23
    0
    votes
    1 answer

    PreferenceScreen size for different device size

    I have a PreferenceScreen but I want have it on big devices also, but the elements don't scale and I cannot change its size. On tablets it looks really small and I want make it bigger, how to do it? This is how it looks right now: xml
    Senio Vak
    • 87
    • 4
    • 11
    0
    votes
    1 answer

    App crash Android

    My app crashes every time I try to access the settings menu. I am taking a course through udacity for android development. The app runs fine when I load the AVD, and it does not give me any errors. I am thinking it has to do with how I set up the…
    mountis
    • 1
    • 3
    0
    votes
    2 answers

    Custom PreferenceActivity Layout is lost for nested PreferenceScreens

    I have a preference activity which gets it's layout from the following XML. This makes a button appear at the bottom of the preferences.
    stealthcopter
    • 13,964
    • 13
    • 65
    • 83