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

    Failed to find provider in android TV Preferences fragment

    Getting Failed to find provider com.google.android.katniss.search.searchapi.VoiceInteractionProvider for user 0; expected to find a valid ContentProvider for this authority for tv Preference Fragment E/AndroidRuntime: FATAL EXCEPTION: main …
    1
    vote
    0 answers

    Why the PreferenceScreen diaplays incorrectly in sdk version 28? How to solve it?

    implementation "com.android.support:appcompat-v7:28.0.0-rc01" implementation "com.android.support:preference-v14:28.0.0-rc01" This the code in my build.gradle.And I write a settings_pref.xml.It does not display corrently in Android Studio and my…
    1
    vote
    2 answers

    How to launch PreferenceScreen from the parent one

    I've added in my app a simple AlertDialog that asks if the user wants to be redirected to the info PreferenceScreen. I'd like to know how to launch a child PreferenceScreen from the parent one. Thanks.
    En_t8
    • 7,595
    • 5
    • 20
    • 14
    1
    vote
    1 answer

    up button from preference fragment to return to preference headers

    My app has preference headers on which you choose what fragment to start. After you are in some fragment I want that click on back button shows header again and if I press back again when headers are shown to return me to some other activity. I…
    faleksic
    • 176
    • 10
    1
    vote
    2 answers

    How to remove the padding between preference title and the following preference?

    I would like to remove the purple gap in my preference screen: preference so that it should look like this: Google Play Store example I'm using Xamarin Android and c# to develop my app. The preference screen is an PreferenceFragmentCompat from…
    1
    vote
    2 answers

    Can I right align an icon for a preference?

    I have a preference in which I am setting my title and summary programmatically PreferenceScreen screen= parent.getPreferenceManager().createPreferenceScreen(context); screen.setTitle(R.string.color_title); …
    SuperCode
    • 11
    • 2
    1
    vote
    0 answers

    Is there a way to put a clickable icon next to a Preference?

    I am remaking our custom preferences screen into PreferencesScreen. We currently have several settings, for example checkboxes, with a questionmark icon next to it that users can click to get information about the setting. The built-in preferences…
    1
    vote
    0 answers

    Options Menu, PreferenceScreen and Date Picker

    I try to open the preference screen with the option menu. The drawable of the option menu is visible in the right corner but when I click on it the app crashes. Could anyone tell me why? public boolean onOptionsItemSelected(MenuItem item) { …
    ahs123
    • 11
    • 3
    1
    vote
    1 answer

    Custom Preference shows differently on Preference screen than native Preferences

    A picture is worth a thousand words, this is my problem: The last three preferences are a custom time picker for minutes and seconds The other settings are the normal SwitchPreference, RingTonePreference, ListPreference and…
    ilomambo
    • 8,290
    • 12
    • 57
    • 106
    1
    vote
    0 answers

    Android Preference like Android 6 native Settings

    How can I achieve this? I've been searching and found nothing. Is it using 'com.android.support:preference-v7:+'?
    1
    vote
    1 answer

    Appcompatactivity with custom native (not compatibility) dialogpreference containing a TimePicker

    I am building a preferences / settings screen inside an Android AppCompatActivity. One requirement is a custom [DialogPreference][1] with a TimePicker. The DialogPreference must be 'native', meaning not the compatibility version like described here…
    1
    vote
    2 answers

    TextView gets overlaped(instead of Overwriting)in a Preference Screen

    I am trying to build a preference screen which consists of a Layout with some TextViews and EditText Preference. When I use textView.setText(inputString) in the Activity, it does not overwrite the existing TextView, instead it creates a new copy of…
    1
    vote
    0 answers

    Add PrefererenceScreen to PreferenceScreen from code

    I have a PreferenceFragmentCompat that I populate with a call to: setPreferencesFromResource(R.xml.settings, rootKey); After this I have a screen with editable text and checkboxes and what not. Is it possible to add a inner PreferenceScreen after…
    1
    vote
    1 answer

    PreferenceScreen Layout in sliding tabview/layout

    How can i include a preference.xml in a fragment that is in a tab? All i want is the layout i have my own logic for settings, i just want the standard preferencescreen look. This is my latest attempt.
    kluki
    • 59
    • 11
    1
    vote
    1 answer

    Creating custom preference screen in android

    I have created a PreferenceScreen(pref_screen.xml) for my settings menu. It contains list of objects with different categories. I have created another custom layout(settings.xml) containing buttons, views, texts, images. I would like to know how…
    telmomarques
    • 21
    • 1
    • 4