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

    Open a Sub-Preference Screen of SettingsActivity on button click

    My SettingsActivity has sub-preference screens. I want to directly open one of the nested PreferenceScreen in SettingsActivity from another Activity on button click. Basically, I want the user to be redirected from an Activity to the sub-section of…
    1
    vote
    1 answer

    Why Toast appears more times than I need?

    The problem is that a Toast appears as many times as you open Settings activity, while I need it only once after each click on CheckBox. Thanks in advance to everyone, who tried to improve my code. More detailed description of how the code works: I…
    1
    vote
    2 answers

    PreferenceActivity with multiple PreferenceScreens without Headers

    I would like to do a normal PreferenceActivity (in the old style, without headers), but with fragments and without using addPreferencesFromResource(id) (because deprecation). Right now I achieved this by putting this in my…
    Chaoz
    • 2,119
    • 1
    • 20
    • 39
    1
    vote
    1 answer

    Android PreferenceScreen and Preference widget instance access

    In my app exist my own class public class ColorAccesoryView extends View{ @Override protected void onDraw(Canvas cv){ } } used in layout color_accesory.xml
    theWalker
    • 2,022
    • 2
    • 18
    • 27
    1
    vote
    1 answer

    SeekBarPreference is deprecated?

    I was searching and i saw only old examples of SeekBarPreference and i tried do it in XML but intelsense don't detect it or if I do ctrl+space or other things don't show. So I went to check Android developers and I went in this site and in the left…
    1
    vote
    2 answers

    Remove padding from PreferenceScreen that is created programatically in PreferencesListFragment

    I have settings screen which is Fragment extending PreferencesListFragment. In which first there is main PreferenceScreen in which there are multiple nested PreferenceScreen like below layout: //general settings …
    Rajesh Jadav
    • 12,801
    • 5
    • 53
    • 78
    1
    vote
    2 answers

    Call same PreferenceActivity from different Views, different values

    Let's say I have 10 buttons whose ID's are 1,2,...,10. I have an XML file called preferences.xml that contains a checkbox:
    zuokuok
    • 323
    • 1
    • 6
    • 16
    1
    vote
    1 answer

    "Unsupported type 'PreferenceActivity' in file" Android

    I'm still new in Android programming, and I just can't solve this problem. I'm creating a Preference Screen, but at the moment I run the application, I get the following error: Error:Execution failed for task ':app:mergeDebugResources'. >…
    MexicanGuy
    • 13
    • 5
    1
    vote
    1 answer

    How can I open Preference screen by long press from a key of sample keyboard?

    I am a beginner about java and android. I am learning about Sample softkeyboard in Android studio. I want to know how I can open Preference Screen by long press on a key (like Globe key) of sample keyboard instead of going to Setting menu of my…
    1
    vote
    1 answer

    disable multiple preferences under PreferenceScreen/PreferenceCategory

    I have ListPreference which I want to use it for enable/disable multiple preferences which are all under PreferencesScreen/PreferencesCategory (in same activity), so how to do that in one shot? is there an easy way to disable or enable a grouped…
    Eng. Samer T
    • 6,465
    • 6
    • 36
    • 43
    1
    vote
    1 answer

    Xamarin Android - getting preferences from preferenceFragment

    I have an app which uses preferenceScreen (checkboxes) for the user to turn on and off certain options. The preferences fragment which inflates the xml file looks like this: public class BrandsFragment : PreferenceFragment { public…
    1
    vote
    0 answers

    XCODE 6 change storyboard template background

    I did a search on this and found many posts about changing the background color and all of them were showing result about changing the background color of the VIEWS in the project. THIS IS NOT WHAT I WANT I want to change the background of the…
    Jeff Janes
    • 885
    • 1
    • 8
    • 22
    1
    vote
    1 answer

    Android Admob banner on all preferencescreens

    I'm having trouble placing an AdMob banner in settings. I have managed to place it in the first screen by using the following layout:
    1
    vote
    0 answers

    PreferenceFragment changing ActionBar

    I have an app that has a navigation drawer throughout the app. I've just added a Preferences Activity with a nested PreferenceScreen. All works well on the main screen, but when I click into the nested screen, the ActionBar defaults to the Android…
    1
    vote
    1 answer

    How to display some colored text in an Android Preference sub screen

    I'm trying to display some colored text in my preference screen. To do so I'm creating a Spannable like this: final String completeString = title + " - " + (TextUtils.isEmpty(currentValue) ? "?" : currentValue); SpannableString span = new…