PreferenceActivity in Android is a base class for an activity to show a hierarchy of preferences to the user
Questions tagged [preferenceactivity]
680 questions
16
votes
1 answer
Using non-default preferences in PreferenceActivity
Using PreferenceActivity, Android automatically saves simple preferences such as checkboxes being checked etc. I have a couple of questions:
1 - where do these preferences get saved? Is it the same preferences file that…

barry
- 4,037
- 6
- 41
- 68
16
votes
1 answer
Get the Ringtone title from RingtonePreference
I have a RingtonePreference that is used to select a ringtone that is broadcasted to a receiver used in an Alarm application.
I would like to display the title (the titles displayed in the list you see when you choose the ringtone) of the selected…

Alex Bergsland
- 325
- 2
- 9
16
votes
2 answers
PreferenceFragment crashing, Null object Reference
I have a simple ActionBarActivity which holds a PreferenceFragment as follows:
import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceFragment;
public class SettingsActivity extends Activity {
…

Ryan
- 762
- 8
- 17
15
votes
3 answers
Android get view of Preference in PreferenceActivity
I would like to get View instance that is used to display specific Preference in my
PreferenceActivity, so i can modify its properties, for example:
public class SettingsActivity extends PreferenceActivity {
public void onCreate(Bundle…

hendrix
- 3,364
- 8
- 31
- 46
14
votes
7 answers
SharedPreferences will not save/load in PreferenceActivity
EDIT: The problem described below was due to a very peculiar device issue not caused by any coding-related problem.
I have a preferenceActivity in which I have many checkBoxPreferences.
The checkBoxPreference is suppose to save the the default…

Reed
- 14,703
- 8
- 66
- 110
14
votes
2 answers
Building Compatibility PreferenceFragment on Android
My android application is using the compatibility library quite heavily (Loaders in particular). I need to be able to use compatibility components everywhere, including my PreferenceActivity. Sadly, the support library does not include a…

Karakuri
- 38,365
- 12
- 84
- 104
14
votes
2 answers
How to get elements(findViewById) for a layout which is dynamically loaded(setView) in a dialog?
I need to get the EditText that's defined in an xml layout which is dynamically loaded as a view in a preference dialog i.e. :
public class ReportBugPreference extends EditTextPreference {
@Override
protected void…

Vikas Singh
- 1,781
- 7
- 27
- 54
13
votes
4 answers
add action bar with back button in preference activity
Here is my preference activity:
package com.example.hms.test;
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class PrefsActivity extends PreferenceActivity {
public void onCreate(Bundle savedInstanceState) {
…

user6313452
- 161
- 1
- 2
- 10
13
votes
4 answers
How to handle long text in preferences on Android?
Background
I'm making an app that has some settings, and I want to use the built in PreferenceActivity or PreferenceFragment for the job
The problem
Some of the preferences have a long title which I cannot shorten, plus I think that if I ever…

android developer
- 114,585
- 152
- 739
- 1,270
12
votes
6 answers
How do I create one Preference with an EditTextPreference and a Togglebutton?
What I'm trying to implement is basically and exact replica of the image below (the preferences that I've squared). Pressing anything to the left of the preference should open up a dialog. Pressing the togglebutton will disable/enable whatever I'm…

CodePrimate
- 6,646
- 13
- 48
- 86
12
votes
4 answers
Dynamically create CheckBoxPreferences
I am currently building out a list of rows with checkboxes dynamically using content from a web service. However, this ListView will need to do pretty much what a PreferenceActivity would accomplish.
I don't know the number of rows as the content…

askilondz
- 3,264
- 2
- 28
- 40
12
votes
3 answers
Show up-Button in actionBar in subscreen preferences
I've implemented my preferences like shown in the official guidelines.
I have a PreferenceActivity which creates the PreferenceFragment like this:
@Override
protected void onCreate(Bundle savedInstanceState)
{
…

user1567896
- 2,398
- 2
- 26
- 43
11
votes
0 answers
Android: Reverse Preference dependencies
Possible Duplicate:
How to do opposite of of preference attribute android:dependency?
In a PreferenceActivity, we can define Preferences with XML code. One of these is:
android:dependency
This can be used to set a preference to only be sensitive…

Joel Auterson
- 728
- 1
- 7
- 26
11
votes
5 answers
AppCompatPreferenceActivity strange padding on left and right in Android 4.4
I have an SettingsActivity extending AppCompatPreferenceActivity.
my pref_headers.xml looks like this:

progNewbie
- 4,362
- 9
- 48
- 107
11
votes
1 answer
How to use PreferenceScreen in Android
i want use PreferenceScreen for setting page, i know use EditTextPreferences and use this text. but i don't know other Objects, for example : i don't know change text color from ListPreference, or i don't know show/hide text from CheckBoxPreference.…

Dr.NoBody
- 1,585
- 3
- 12
- 13