Questions tagged [preference]

445 questions
15
votes
5 answers

how to hide the divider between preferences in fragment

I want to hide the divider between preferences in fragment. The code is below: 1.SettingsActivity.java public class SettingsActivity extends PreferenceActivity { super.onCreate(savedInstanceState); SettingsFragment settingsFragement = new…
soildong
  • 151
  • 1
  • 4
14
votes
5 answers

Android: How to adjust Margin/Padding in Preference?

Before I asked to remove the padding of the PreferenceActivity/PreferenceFragment: Android: How to maximize PreferenceFragment width (or get rid of margin)? This time I having trouble adjusting margin/padding before Title Text. (See image…
jclova
  • 5,466
  • 16
  • 52
  • 78
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

Customizing the layout of a PreferenceScreen

My requirements Note: I need to support Android API 15 and onwards. In my PreferenceFragment I am dynamically adding PreferenceScreen's to a PreferenceCategory. PreferenceScreen as = mgr.createPreferenceScreen(context); as.setTitle(name);…
se22as
  • 2,282
  • 5
  • 32
  • 54
13
votes
4 answers

Android PreferenceScreen title in two lines

I have PreferenceScreen with long title especially in some languages. I'm able to set multiple lines title for CheckBoxPreference or ListPreference with this: Android preference summary . How to set 3 lines in summary? , but how to set 2-lines…
Miroslav Michalec
  • 1,569
  • 1
  • 19
  • 22
13
votes
2 answers

Android preference summary . How to set 3 lines in summary?

Summary of preference is allowed only 2 lines . If I want to display 3 lines or more in summary . How can I do ?
kikura
  • 185
  • 2
  • 11
13
votes
4 answers

How make a ListPreference with checkbox

How can I create a ListPreference with checkbox? I know how to use ListPreference, but I need multiple selection like in Alarm application on "repeat" preference. like this screenshot:
Tek Yin
  • 3,011
  • 3
  • 25
  • 42
13
votes
2 answers

Allow JavaScript from Apple Events in Safari through Terminal Mac

I'm writing a program that executes do javascript in Safari. The only problem is that I'm trying to make the app give its self permission to do it. I'm trying to locate the file that handles the Safari developer preferences so that I can do this.…
Levi Muniz
  • 389
  • 3
  • 16
13
votes
2 answers

Change Preference Item Summary Text Color in Android 4

I have the below sample of preference items I use a theme in the res/values to change the Summary text color
AntounG
  • 543
  • 1
  • 6
  • 9
10
votes
1 answer

Instantiating an inner class (Preference) in xml file

When you want to access a custom view in some layout.xml file, you have two options: The view is in it's own class. Then you do The view is an inner class:
10
votes
2 answers

Customizing CheckBoxPreference via android:widgetLayout

I have a Preference that enables a sync adapter, and takes a while to actually do its work when toggled. Consequently, when the user clicks the Preference, I spin off an AsyncTask to do the work. In the meantime, I disable the Preference and…
loganj
  • 215
  • 2
  • 7
9
votes
3 answers

Preference On Change Listener

I have read this helpful post : SharedPreferences.onSharedPreferenceChangeListener not being called consistently However I am having no luck. I am trying to create an OnSharedPreferenceChangeListener that runs in a service. Everything is…
jjNford
  • 5,170
  • 7
  • 40
  • 64
9
votes
2 answers

How to instantiate layout for custom preference, using android:layout attribute

I can set appropriate layout for preference through android:layout attribute. For an example
hardsky
  • 514
  • 5
  • 15
9
votes
2 answers

Reload Preferences in PreferenceActivity on Resume

In my app, some settings can possibly be changed while the PreferenceActivity is not open, and an issue I'm running into is that addPreferencesFromResource is called in onCreate, so say, I open the PreferenceActivity, then go to another screen from…
Reed
  • 14,703
  • 8
  • 66
  • 110
9
votes
1 answer

Change PreferenceCategory android:title

I was wondering if there was a way to change the PreferenceCategory android:title="my name" programmatically and or the ListPreference android:title="my name" programmatically.
Keith
  • 261
  • 1
  • 3
  • 8
1
2
3
29 30