Questions tagged [checkboxpreference]

CheckboxPreferences are boolean values stored in SharedPreferences

Click here To know more about this class.

95 questions
3
votes
2 answers

Start/Stop service by checking/unchecking CheckBoxPreference

i'm writting an app that start or stop service by checking or unchecking CheckBoxPreference i tried to find some information such as sample code or tutorials. but i didn'f find yet. how to start or stop service by checking or unchecking…
sukso
  • 145
  • 1
  • 8
2
votes
0 answers

How to put CheckBoxPreference on pop out dialog like ListPreference

I have several preferences items that a user can choose from and wanted to have them on a CheckBoxPreference widget. Since its a list of over 7 Items; on a preference activity with other options, it may lead to an unsightly scrolling IMHO. So I…
2
votes
3 answers

How to handle checkbox status manually?

I need to control a CheckBoxPreference manually; I have to check a condition in my own data to determine if the preference can be set or not. How can I do it? My current code is as follows, but it doesn't seem to work. CheckBoxPreference buyPref =…
LA_
  • 19,823
  • 58
  • 172
  • 308
2
votes
0 answers

CheckBoxPreference SwitchCompat missing animation

I have spent more than 10 hours trying to get the animation of the switch to work. I have tried so many things that I don't remember several of the attempts, but I'll explain those that I remember. Code that should work (I think): I use the…
2
votes
1 answer

Android testing preferences fragment by Expresso

I have got a problem with testing my code by Expresso. I wrote this code: public class SettingsActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
user6532769
2
votes
2 answers

Preferences & CheckBoxPreference

The documentation for the PreferenceActivity states "These preferences will automatically save to SharedPreferences as the user interacts with them." That being the case, if I subclass PreferenceActivity, invoke addPreferencesFromResource in…
PAS
  • 68
  • 6
2
votes
1 answer

Custom CheckBoxPreference performance

I'm using this CheckBoxPreference Class to support RTL text direction for pre Android 4.2 versions and to use a custom font style for my preference public class MyCheckBoxPreference extends CheckBoxPreference { TextView txtTitle, txtSum; …
Leebeedev
  • 2,126
  • 22
  • 31
2
votes
3 answers

Make CheckBoxPreference store a String ("true"/"false") instead of a Boolean in SharedPreferences

I have a PreferentFragment whose content is loaded from a .xml file containing a CheckBoxPreference
José D.
  • 4,175
  • 7
  • 28
  • 47
2
votes
1 answer

Value from CheckBoxPreference is not retained

I have a following preference in my xml file: I wanted to make my own custom checkbox, so…
rootpanthera
  • 2,731
  • 10
  • 33
  • 65
2
votes
3 answers
2
votes
1 answer

Howto enable/disable Flash in Preferences on Android WebView?

I'm developing a browser for Android. Is it possible to create a Checkbox Preference to enable and disable Flash plugin (webview.setPluginsEnabled) in the Preferences?
1
vote
2 answers

CheckBoxPreference - onSharedPreferenceChanged method not getting called

I have a couple of CheckBoxPreferences set up, my preference class extends PreferenceActivity and implements OnSharedPreferenceChangeListener This is what I'm using to respond to people checking/unchecking the CheckBoxPreferences: public void…
ZOMGbies
  • 51
  • 1
  • 1
  • 7
1
vote
1 answer

Android Preferences Layout

I am using CheckBoxPreference in my preferences activity. The application is written in hebrew, which is RTL language. Does anyone knows if I can change the direction of the CheckBoxPreference, so that the checkbox will be on the left and the text…
SuperFrog
  • 7,631
  • 9
  • 51
  • 81
1
vote
4 answers

How to get CheckBoxPreference value within the Receiver/Service in Android?

I use CheckBoxPreference in my PreferenceActivity to set a value. Later on, I want to check that value from Receiver and/or Service. findPreference() method is not available from that context. I know, that this preference value is stored in…
jacek
  • 947
  • 1
  • 11
  • 20
1
vote
1 answer

EditText in PreferenceScreen and DialogPreference containing PreferenceScreen/CheckBoxPreference

I have an application, where I want there to be several EditTexts on one screen, and then to the right of each, a button that will open a dialog for settings related to that EditText Issue is, I am trying to do this within a PreferenceActivity. I…
Reed
  • 14,703
  • 8
  • 66
  • 110