Questions tagged [checkboxpreference]

CheckboxPreferences are boolean values stored in SharedPreferences

Click here To know more about this class.

95 questions
1
vote
1 answer

Unsucceedable cast when declaring CheckBoxPreference

After declaring a CheckboxPreference in my activity for my app's settings, a warning appears for as in the line 'val mCheckBoxPreference = findPreference("preference_a") as CheckBoxPreference'. What should be done so that the cast does…
wbk727
  • 8,017
  • 12
  • 61
  • 125
1
vote
2 answers

CheckboxPreference onClick()

I want to implement a 2 part preference screen. If checkbox is clicked, first category should lock and 2nd one unlock. If it's not, reverse. Now I see it only works if I go to previous activity and then to new (sharedPreferences). What listener…
Lovro Pandžić
  • 5,920
  • 4
  • 43
  • 51
1
vote
0 answers

ClassCastException on PreferenceFragment start

I have 2 activites, MainActivity and SettingsActivity. When settings button is pushed, SettingsActivity is started and loads PreferenceFragment. App immediately crashes on fragment start: 9188/com.app.android.judge E/AndroidRuntime: FATAL…
1
vote
0 answers

OnPreferenceClickListener work wrong in CheckBoxPreference

I have an CheckBoxPreference and i setOnPreferenceClickListener mCheckBoxPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { …
1
vote
1 answer

set the value of CheckBoxPreference to false in Android

I have a checkboxpreference which performs a tasks once it is clicked on. I want to uncheck it if the task fails. But I am not sure why it is not working. The preferences.xml:
Rain Man
  • 1,163
  • 2
  • 16
  • 49
1
vote
1 answer

Why Toast appears more times than I need?

The problem is that a Toast appears as many times as you open Settings activity, while I need it only once after each click on CheckBox. Thanks in advance to everyone, who tried to improve my code. More detailed description of how the code works: I…
1
vote
1 answer

CheckBoxPreference with Button

I found the answer to my question here: CheckBoxPreference with additional Button? But I really did not understand how to do it. Probably due to the fact that I do not know much English. I need to put into ChekBoksPreferens button. Can anyone give…
niklas1987
  • 61
  • 9
1
vote
0 answers

Change checkbox/list default-value in smali

I'm trying to change default-values in Settings.apk. At first I added "android:default value" (0=right, 1=centered) to status_bar_clock_style.xml without success.
1
vote
1 answer

Wrong CheckBoxPreference title color on kitkat device using AppCompat22

I have an issue with the title color of CheckBoxPreference in my settings screen. I am using AppCompat with appcompat-v7:22.2.0. On a Lollipop device, no issue. AppCompat lib works as expected, that is, CheckBoxPreference title is painted in…
1
vote
2 answers

Android checkboxpreference disabled even though it's enabled in XML

I currently have the problem of a disabled checkbox preference which is enabled in the preference.xml. This happened after the migration to Metarial design. I tried to enable the view programmatically but it didn't help. (I'd like to show a…
Takeya
  • 123
  • 12
1
vote
3 answers

Show extra info for Preference screens when CheckboxPreference summary field is not enough long?

I have a screen where you can enable/disable modules for my Android application. For this I use a CheckboxPreference screen. This is all good, but the summary field gets cut off if longer descriptions are added than 2 lines. Suppose I have 4-5 lines…
Pentium10
  • 204,586
  • 122
  • 423
  • 502
1
vote
2 answers

Is it possible to add long press listener to CheckBoxPreference?

The answers in this thread are not helping in any way. I have one requirement where I want to do something when user long presses on CheckBoxPreference. I am dynamically creating the CheckBoxPreference inside activity. I am using below piece of code…
Green goblin
  • 9,898
  • 13
  • 71
  • 100
1
vote
2 answers

Getting the Value of a CheckBoxPreference

I want to get the value from a CheckBoxPreference, I have defined it in Convert/res/xml/settings.xml, here is how it looks:
Ved
  • 389
  • 3
  • 7
  • 16
1
vote
0 answers

Activating and Deactivating PushBots from CheckboxPreference

I am using PushBots in my Android Application but would like to give the user an option to Enable or Disable the Notifications. On the PushBots website, it says that running the code Pushbots.getInstance().setRegStatus(false); will do this for…
luc122c
  • 409
  • 9
  • 17
1
vote
1 answer

How to rerun onCreate, after user selects preference.

So to make things simple my app consists of a bunch of cards (Google style). In the settings the user can select which card is viewable in the main activity. My problem is that I cant figure how to update the main activity after the user selects…