Questions tagged [checkboxpreference]

CheckboxPreferences are boolean values stored in SharedPreferences

Click here To know more about this class.

95 questions
0
votes
1 answer

Android Espresso: unable to find CheckBoxPreference with unique android:id

I am trying to test a checkbox on a PreferenceScreen. The PreferenceScreen contains two CheckBoxPreferences, each with unique android:id.
0
votes
2 answers

Failed to query value from Android Checkbox Preference

I have two activity below. See my code... SettingsActivity.java public class SettingsActivity extends AppCompatPreferenceActivity { static CheckBoxPreference checkBoxPreference; @Override protected void onCreate(Bundle savedInstanceState) { …
Muhammad Jobayer
  • 157
  • 1
  • 10
0
votes
1 answer

How to use the preferences of my preferences.xml file in my fragments?

I have two packages in my android app: the MainActivity that handles my NavigationDrawer in the first package, and the fragments of the NavigationDrawer in the second package. Now I created a settings_fragment in the second package for some user…
0
votes
1 answer

Toggle return value for CheckboxPreference onClick

I need to find a way to toggle the return value when clicking my CheckboxPreference. I have already set a key in my settings.xml. The click works fine, I'm just curious about how to return a new value upon each click. final Preference…
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
0
votes
1 answer

How to set Image in CheckBoxPreference

I want to add 4 image into a Check Box Preference in Preference Screen. or is it any way so that i can put 4 image in one line and at the end Check Box in Preference Screen.
0
votes
0 answers

CheckBoxPreference change checkbox icon

I need to change the check and uncheck icon in my preferenceScreen, I already have tried many ways, but all of them have failed, on my last attemp I have added one more check box beside of the default example image my prefence.xml
user3672263
  • 283
  • 1
  • 3
  • 10
0
votes
1 answer

CheckBoxPreference - set summaryOn

I got a problem with my PreferenceActivity. I'm using XML mainly, but some Preferences I add via code, that all works fine. But I ran into a problem. I added a CheckBoxPreference programmatically - that works. But I'd like to set the summaryOn and…
hclemens
  • 23
  • 1
  • 7
0
votes
2 answers

change CheckBoxPreferesses if normal checkbox is chacked

I'm working on an android application, and i have in my signup layout a checkbox for a value that can be edited from my settings (settings are sharedpreferences) so when the user signup can check that checkbox and if this checkbox is checked so the…
Adams
  • 105
  • 4
  • 10
0
votes
1 answer

custom checkbox in checkboxPreference - summaryOn & summaryOf

I would like to change a default checkboxPreference layout a bit. I use answers from other similar question but still there is one thing that does not work. I've got:
Malvinka
  • 1,185
  • 1
  • 15
  • 36
0
votes
2 answers

Android how to filter which preferences are displayed

I have 2 preference pages. Depending on a checkbox displayed on the preference page "one" I want to display a CheckBoxPreference or not display it on the page "two". I know that I should add on the activity of the page "two" a way to handle if the…
user2983190
0
votes
3 answers

Android-One clicklistener for many CheckBoxPreference

I have some CheckBoxPreference elements for which I would like to use one onClickListener for all the CheckBoxPreference in my page. Here is what I'm trying to do: CheckBoxPreference checkboxPref =…
user2983190
0
votes
1 answer

Android how to show pop up on clicking CheckBoxPreference

I have a PreferenceScreen in which i have a checkbox with the following code:
user2983190
0
votes
0 answers

Android CheckBoxPreference and global variables

I am developing an android browser and i have a CheckBoxPreference that i want it to set a global int variable to 1 if checked and to 0 if unchecked here's my code: xml/prefs
Bisho
  • 5
  • 4
0
votes
1 answer

How to cancel a CheckBoxPreference with a YES/NO confirm dialog

I want to ask the user to confirm the change of a CheckBoxPreference in the settings of my application. I tried to put an AlertDialog in both OnPreferenceClickListener and OnSharedPreferenceChangeListener but I did not succeed in CANCELLING the…
u2gilles
  • 6,888
  • 7
  • 51
  • 75
0
votes
1 answer

How to change Text Color of CheckBoxPreference's Title in android?

I want to do this: when the CheckBoxPreference is unchecked, the text color of the CheckBoxPreference's title become gray and if checked, the title's text color reverts to original color (depends on the theme). What I did until now: I created a new…
null
  • 8,669
  • 16
  • 68
  • 98