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

    Getting value from edittext preference in preference screen

    I'm new to android development. I just heard about preference screen in android. So I just made one. This is just to enter name in a dialog.
    4
    votes
    1 answer

    Use TimePicker or DatePicker within Preferences Screen on Android

    I'm trying to figure out how to implement a Data and Time picker for and app I'm building. I can't seem to find a built in way to allow the user to set the date they quit. Is there an elegant way to implement one? I'll need to be able to pull the…
    Tabrock
    • 1,120
    • 1
    • 20
    • 37
    4
    votes
    1 answer

    Open fragment from Preference fragment; Change action bar layout from nested Preference screen on Android

    I've got PreferenceFragment added in activity, so I see my preferences (and the most important I see my custom action bar). But this fragment has nested preference screens inside and when I click one of those then action bar is changed to default…
    bakua
    • 13,704
    • 7
    • 43
    • 62
    4
    votes
    2 answers

    How create a settings menu with checkbox Android

    I want to create a preference screen in which there are three checkboxes; the first one is clickable and the other two are not until the first is checked. How can I do this? I've seen this tutorial, but there is only one checkbox. Can anyone help…
    4
    votes
    2 answers

    Where are the settings of a preferences screen stored?

    I know this question is a little stupid but I cannot find where the settings of my preferences screen are stored. I am using shared preferences this file is located at /data/data/my.package.name/shared_prefs/common.xml. However when I change…
    rekire
    • 47,260
    • 30
    • 167
    • 264
    4
    votes
    1 answer

    Android Preference Screen without XML

    I want to create a preferences screen without writing an XML layout file. I'd like to store the settings in a SQLite database. Is this possible?
    3
    votes
    2 answers

    RingtonePreference getEntry method

    I want to display current selected value in my preferences screen in summary label. For ListPreference, I used getEntry method in public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { method, my class is: public…
    Kolesar
    • 1,265
    • 3
    • 19
    • 41
    3
    votes
    1 answer

    Android PreferenceScreen onChangeListener not invoked

    i wrote a simple PreferenceScreen, looks as follows: public class SettingsActivity extends PreferenceActivity implements OnPreferenceChangeListener { @Override protected void onCreate(Bundle savedInstanceState) { …
    poitroae
    • 21,129
    • 10
    • 63
    • 81
    3
    votes
    0 answers

    AndroidX Preference library DropDownPreferences doesn't work on API < 24

    I've finished migrating to AndroidX Preference library and while everything works perfect on API 24-29, it reacts weirdly on older ones<24. The Dropdown preferences are not responding on selection but the dialog ones are. What changed on API 24 that…
    3
    votes
    2 answers

    Change text size on the positveButtonText in the EditTextPreference dialog

    I cannot figure out how to change the text size on the buttons in the EditTextPreference dialog popup box. I would like all my text throughout my app to be streamlined at 24 sp. This is happening everywhere except this dialog box from the…
    tzg
    • 616
    • 1
    • 8
    • 17
    3
    votes
    3 answers

    Android: How to use Buttons in Preference Screen

    I'd like to provide a Button in the PreferenceActivity. The user should be able to set a time (e.g. via TimePicker), but there's no ButtonPreference or something like that. I don't want to use EditTextPreference. So do I have to use a default Button…
    3
    votes
    3 answers

    How to remove the horizontal line in the bottom in PreferenceScreen?

    I am getting one horizontal line in but there is not any horizontal line in the bottom ,I don't know where is wrong
    zys
    • 1,306
    • 3
    • 18
    • 37
    3
    votes
    2 answers

    Make a normal layout look like a PreferenceScreen

    The PreferenceScreen isn't good enough for me, since I've to add items to a Spinner. Those items need to come from a data list. I've got a custom ArrayAdapter that returns the name of the item, and when I click it. It returns the data that is…
    tim687
    • 2,256
    • 2
    • 17
    • 28
    3
    votes
    4 answers

    PreferenceActivity not displayed (Blank Screen)

    I am following these instructions to create a PreferenceActivity but the PereferenceActivity is not displayed. Activity starts but the Layout is blank. I am also using material design NavDrawer in my Application by referring to…
    3
    votes
    0 answers

    Preference's onCreateView is being called multiple times in Android

    I have a PreferenceScreen containing few Preference objects. The first Preference inside the PreferenceScreen is a custom preference. Now the problem is that the onCreateView() for that custom preference is calling multiple times. If I change the…
    Vivek
    • 1,823
    • 1
    • 19
    • 39
    1 2
    3
    13 14