Questions tagged [android-checkbox]

Checkboxes allow the user to select one or more options from a set.

A checkbox is a specific type of two-states button that can be either checked or unchecked.

Initial help

734 questions
311
votes
26 answers

How to change the color of a CheckBox in Android

How do I change the default CheckBox color in Android? By default the CheckBox color is green, and I want to change this color. If it is not possible please tell me how to make a custom CheckBox?
Piyush
  • 5,607
  • 4
  • 27
  • 27
141
votes
10 answers

Android: checkbox listener

I want to put a Listener over a CheckBox. I looked for info and it is like this: satView = (CheckBox)findViewById(R.id.sateliteCheckBox); satView.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void…
Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207
71
votes
9 answers

Android Checkable Menu Item

I have the following menu layout in my Android app:
Icemanind
  • 47,519
  • 50
  • 171
  • 296
34
votes
6 answers

How to set checkbox border color

The checkbox border is invisible on white background. I played with different color parameters without success. I need black border of box. Yes, there examples to make custom checkbox. In all drawable examples the normal box is visible inside of…
Niaz
  • 545
  • 2
  • 12
  • 21
29
votes
1 answer

ListView item with checkbox - how to remove checkbox ripple effect?

I have a ListView with item contains a checkbox and some other elements. The problem is when I click on the list item on Android 5+ device I have it looks like this: I don't want to have ripple effect around the checkbox. How can I acheive…
udenfox
  • 1,594
  • 1
  • 15
  • 25
28
votes
3 answers

Choice Mode in a RecyclerView?

I'm trying to figure out how to achieve the same effect of mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); in a RecyclerView implementation. Please help.
Spike Flail
  • 683
  • 3
  • 8
  • 17
21
votes
5 answers

disable checkbox after checked, android

I want to achieve this : user check on a unchecked checkbox, a toast displayed, the checkbox then become disable.. male.setOnCheckedChangeListener(new OnCheckedChangeListener(){ @Override public void onCheckedChanged(CompoundButton arg0,…
cgpa2.17
  • 309
  • 1
  • 3
  • 12
20
votes
2 answers

android spinner dropdown checkbox

I have Spinner like this :
19
votes
6 answers

How to create the checkBox in circular shape?

I am facing the issue in creating the checkbox in circular shape in android. I tried many methods but my problem is not solved.I created the shapes and applied to the checkbox then also problem is not solved.Please help me how to create the check…
Prabha Karan
  • 1,309
  • 3
  • 17
  • 35
18
votes
3 answers

Set background color of unchecked checkbox Android

It has to be like this: Currently it looks like this: The rounded rectangle is not that important. But the unchecked state has to be black. This is my code:
Jim Clermonts
  • 1,694
  • 8
  • 39
  • 94
18
votes
3 answers

Select all checkboxes in RecyclerView

How can I select all checkboxes in recyclerView? I try to do it like this: in Adapter: public void selectAll(){ Log.e("onClickSelectAll","yes"); isSelectedAll=true; notifyDataSetChanged(); } @Override public void…
no news
  • 1,060
  • 3
  • 14
  • 24
16
votes
3 answers

Unable to check/uncheck CheckedTextView inside getView

I'm loading phone contacts in a custom ListView. Each row is a checkable LinearLayout containing a CheckedTextView and another TextView. I'm feeding the list view with a custom ArrayAdapter. My problem is that I can't control CheckedTextViews inside…
Islam Hassan
  • 1,736
  • 4
  • 26
  • 42
13
votes
3 answers

Change checkbox text color when checked

I would like to change color of the text when CheckBox is checked. This is what I have for now:
user4386126
  • 1,205
  • 5
  • 17
  • 32
13
votes
3 answers
12
votes
1 answer

Android Nougat: Why do checkboxes on Fragment have incomplete state when selected programmatically (but look fine on Lollipop)

Here is what my settings tab (Fragment) looks like before any selections are made: From the main Fragment the user can make a selection from the Spinner -- looks like the following (after the user has made a choice): When the user makes that…
1
2 3
48 49