Questions tagged [preference]
445 questions
5
votes
3 answers
Preference ringtone default value
I have this in my preferences.xml

Lukap
- 31,523
- 64
- 157
- 244
5
votes
1 answer
android preference horizontal divider in custom preference?
I've created my own custom preference objects that extend Preference. I've only created them because there are no Preferences for these custom data types.
Everything is working, but my custom preferences don't have the same appearance because they…

TALE
- 960
- 13
- 22
5
votes
0 answers
Android how to get the preferenceScreen of a checkBoxPreference
I have a preference xml file that at some point of it it looks like this:
user2983190
5
votes
1 answer
Check if device is locked in Portrait mode
Is there way to get information if device settings is enable to locked screen orientation?

CoDe
- 11,056
- 14
- 90
- 197
5
votes
1 answer
Create own SwitchCompat Preference
Since the appcompat v7 is missing a SwitchCompatPreference it seems like it's necessary to create it by myself.
How can this be achieved? I googled a bit and found a tutorial for a DialogPreference. I tried to adopt it for a SwitchCompatPreference…

theknut
- 2,533
- 5
- 26
- 41
5
votes
4 answers
Objective C - preferred way to create and initialize an object
Is one of these two ways to create and initialize an object preferable?
MyClass oClass = [[MyClass alloc] init];
oClass.length = 5;
oClass.text = @"Hello";
or using a class method that contains about the same code but looks like this:
MyClass…

Scott Pendleton
- 1,021
- 3
- 16
- 32
5
votes
1 answer
How to access "Open with/Save" dialog to catch the download link?
I have noticed that: If the Mozilla Firefox user clicks on download link (EX: this), the following "Open with/Save" dialog window will pop up:
I have download manager named rd written in Python, So I need to:
Catch the download link from…

esnadr
- 427
- 3
- 18
5
votes
0 answers
Android Preference android:icon getIcon null
I am trying to call getIcon on a Preference declared in xml for android. I am calling it in the onCreate for the preference Activity after all the resources have been inflated.
The icon shows up but if I do findPreference(key) then it calls getIcon…

user1786822
- 107
- 1
- 6
5
votes
1 answer
Set custom theme in Android List Preference
In my Android app, I am using various custom themes in different activities, all of which work fine. All these themes use the same custom styles for buttons, edit controls etc.
My preferences use standard Preference activities, which I define in XML…

OriginalBigBri
- 163
- 2
- 13
5
votes
1 answer
PreferenceActivity works properly on Android 2.1, but not 4.1 (padded)
I'm writing an application. It needs to run on old android OS's to be useful. I have written the preferences screen using a PreferencesActivity that populates with a options.xml file that contains PreferenceScreen. It has no submenu for preferences…

Mgamerz
- 2,872
- 2
- 27
- 48
4
votes
2 answers
getActivity() return null in PreferenceFragment
In my application, I used PreferenceFragment to create a nice application on Tablets and smartphones.
So, in my main activity, I use:
@Override
public void onBuildHeaders(List target) {
loadHeadersFromResource(R.xml.preference_headers,…

Waza_Be
- 39,407
- 49
- 186
- 260
4
votes
1 answer
Combo preference in Android
My desired custom preference looks very much like the out-of-box EditTextPreference, only that it behaves like a "split button" which combines two Preferences: if user clicks on the text on the left, the edit text dialog pops up; which allows user…

mobileTofu
- 1,071
- 2
- 14
- 25
4
votes
1 answer
How to save FCM notification in a custom ArrayList?
I'm trying to save a custom Arraylist in shared preference, but when i restart or re-run and send a new push ,it overwritte the others
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
…

Ervin
- 336
- 1
- 10
4
votes
2 answers
EditTextPreference Disable Buttons?
I want to have an EditTextPreference that will disable the OK button if there is no text in the EditText field. I created a custom EditTextPreference class and I am able to get the EditText object and set a TextWatcher, but I can't find a way to…

Bob
- 891
- 1
- 9
- 14
4
votes
2 answers
Is there a system-wide version of the Preferences API?
In a previous question, I learned about the preferences API. Unfortunately, it only appears to be user-specific preferences. I also have preferences that need to be able to be set across users. What is the platform-independent way to do that in…

Brian Knoblauch
- 20,639
- 15
- 57
- 92