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
    2 answers

    Checkboxpreference change value

    I have checkboxpreference in preference activity and I want that when one of the checkbox is enabled then other checkbox should get to disable and vice versa. I wants to do that from my main class activity. Here is my…
    0
    votes
    1 answer

    PreferenceScreen default settings during first run

    Good day, I have a problem - I have a PreferenceScreen with a ListPreference that has default values. Then, I have an Activity that gets a value from that ListPreference, but it returns "null" if I do not open PreferenceScreen…
    0
    votes
    1 answer

    Android PreferenceScreen overlay Toolbar

    Android PreferenceScreen overlay Toolbar. I have tried to use padding and margin to set Preference Screen under the Toolbar but no any success. NOTE: after changing Toolbar with ActionBar it works as expected. Any help please. Thanks, Hrach
    0
    votes
    1 answer

    Is there a way to launch my app's system settings in a PreferenceScreen

    I can launch the device's App settings activity from a PreferenceScreen. When the activity loads, the activity displays a ListView with all of the different apps installed on the device. I can get to my app's system setting by scrolling through the…
    eric.mcgregor
    • 3,507
    • 2
    • 16
    • 16
    0
    votes
    1 answer

    PreferenceFragment overlaps toolbar in PreferencesActivity

    My problem is that my PreferenceFragment overlaps my toolbar. Since I do not have a layout activity which the fragment comes from, I cannot apply the solutions I have seen elsewhere. I got this far by skipping and deleting the pref_header.xml and…
    0
    votes
    0 answers

    PreferenceScreen with fragment as a button

    On my PreferenceScreen, I would like a return button. I found many links about how create a button in a PreferenceScreen. I tried to implement the solution which consists to import a layout in a Preference tag, but the implementation of…
    Anthony
    • 73
    • 1
    • 2
    • 6
    0
    votes
    1 answer

    Understanding Preference Screen in Android

    I have a Settings.xml layout which has buttons, textviews,etc. I am working on changing this to use PreferenceScreens for the settings layouts. I am aware that I can't use buttons like the way we use in a LinearLayout or any other. My questions are…
    punit1337
    • 21
    • 1
    • 10
    0
    votes
    0 answers

    ListPreference Dialog Title does not show

    I can not see the title of the ListPreference when I open the list popup. I use android:dialogTitle="nectionType" but Nothing is shown top of the dialog title. Any suggestion why could this happen? Thanks. The xml code I use:
    0
    votes
    1 answer

    Pick .mp3 file from sdcard in preferencescreen

    How i can pick mp3 file from sdcard in android preferenceScreen menu.. here is my preferenceScreen:
    0
    votes
    1 answer

    How to show two items side by side in Android PreferenceScreen

    I have two fields that I need to show side by side as shown in the image below in Android PreferenceScreen. How do I go about this?
    Supreme Dolphin
    • 2,248
    • 1
    • 14
    • 23
    0
    votes
    1 answer

    Why android.R.id.list 's parent is FrameLayout not LInearLayout in Android N

    I get the parent layout of preferenceScreen on lower than Android N is the following code : final Dialog dialog = preferenceScreen.getDialog(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { …
    zys
    • 1,306
    • 3
    • 18
    • 37
    0
    votes
    0 answers

    Android PreferenceScreen

    How to in PreferenceScreen line draw image? Example with solid color: EDIT Preference screen is build programmatically, is not defined in xml layout. I only use styles in xml. This not is duplicate as you mark. EDIT & ANSWER is in: Android:…
    theWalker
    • 2,022
    • 2
    • 18
    • 27
    0
    votes
    0 answers

    How to add a dependency on a Preference in Android?

    I write dynamic preferences and I have an IllegalStateException with this code : String key = "pref_key1"; CheckBoxPreference pref1 = new CheckBoxPreference(getActivity()); pref1.setKey(key); Preference pref2 = new…
    Yann
    • 41
    • 2
    0
    votes
    2 answers

    Android: using a PreferenceActivity (or PreferenceFragment) but with my own code to save/load values

    I'm developing an Android app that needs to display a Settings screen with various switches and other stuff. The problem is this: the App is a multi-platform project and I already have custom code that I use to save and load my preferences in a…
    Master_T
    • 7,232
    • 11
    • 72
    • 144
    0
    votes
    1 answer

    Android checkbox preferences and extra options

    Is it possible to setup an android checkbox preferences or list preferences to add more or less items to a preferences screen? If so how can I achieve it? For example I have a simple layout like this: