Questions tagged [oncheckedchanged]

Method to provide a callback when the checked state of a compound button changed in Android.

The onCheckedChanged is a static interface definition for a callback to be invoked when the checked state of a compound button (Checkbox, RadioGroup, etc.) changed:

onCheckedChanged(CompoundButton buttonView, boolean isChecked)  

which has these parameters:

  • buttonView: The compound button view whose state has changed.
  • isChecked: The new checked state of buttonView.

The Reference: CompoundButton.OnCheckedChangeListener
A sample from the Documentation: RenderScriptIntrinsic (MainActivity class)
Tags related: ,

131 questions
2
votes
2 answers

Android: Switch OnCheckedChangeListener in ListView Adapter

I have a listView in my app. For each element in the listView, it has a Switch. Previously I implemented an onClickListener for the Switch inside the listView Adapter's getView method. However, I found that although it does work when user clicks on…
eepty
  • 716
  • 3
  • 10
  • 28
2
votes
1 answer

Why is this code not disabling my button after it has been enabled?

I've got a button on a Windows Form that starts off disabled (Enabled = false). I want to enable it when the user has selected an item from a combobox, and checked at least one item from a CheckedListBox. The user can check/uncheck all the items in…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
2
votes
0 answers

Why is onCheckedChanged not responding?

I have so far the following code for that allows me to set a value to a textview when I click between toggle buttons that are grouped in a radiogroup. For some reason, it seems like the OnCheckedChanged does not get called. Is this the appproach for…
2
votes
2 answers

Checkboxes in Listview custom adapter auto call onCheckChangeListener on scrolling

I have made a listview with custom adapter. It has an Imageview, textview and a checkbox --------------------------------------- --------------------------------------- I am using a SparseBooleanArray named…
lemons
  • 73
  • 8
2
votes
0 answers

RadioGroup.setOnCheckedChangeListener(this) causes NullPointerException

I am from Germany and new in programming with java and Android. In my first App, I have 2 Pages. The first page (aktivity_main.xml) is empty at this moment. There, I want to build a listView. when I go in the menu and click on "Hinzufügen" (-->…
2
votes
1 answer

Firing OnCheckedChanged event with ASP:RadioButton

I have the following RadioButtons:
DevDave
  • 6,700
  • 12
  • 65
  • 99
1
vote
2 answers

Checkbox OnCheckedChange in expandablelist childs

How do i set a OnCheckedChangeListener on each childelements checkbox? I can't figure it out. When i check a checkbox i want a Toast popping up , telling me which child i have checked :) Source: public class ExpandableActivity extends…
Thomas Bolander
  • 3,892
  • 3
  • 22
  • 30
1
vote
2 answers

MAUI RadioButton CheckedChanged with MVVM

In .NET 7, I am trying to send an API request for saving settings choices but I am having some trouble with the events with radio buttons. I want the RelayCommand method (or at least only the contents of the method if I would need to do a check…
jakewags01
  • 41
  • 4
1
vote
1 answer

How do I get the listener from the MaterialButton.addOnCheckedChangeListener { "as a lambda" }

I have some MaterialButtons which changes checked state (in a toggle group scenario). My plan is to listen to the Checked status through MaterialButtons addOnCheckedChangeListener but I need to remove the listener when some conditions occure, how do…
Roar Grønmo
  • 2,926
  • 2
  • 24
  • 37
1
vote
1 answer

Find checkbox column in gridview OnCheckedChange event

I have few gridview columns with checkboxes control that has an autopostback='true' to update a db. When i check one of the checkboxes the entire row gets updated which makes me frustrated. I'm trying to find the checkbox control of the column not…
Nils
  • 516
  • 3
  • 9
  • 33
1
vote
1 answer

I don't understand the pattern of CheckBox click with the new parameter

The following code is used to toggle the CheckBox in order to make the user able to see his password : passwordCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void…
hellohello
  • 65
  • 7
1
vote
2 answers

Fire onCheckChanged event of CheckBox from jQuery aspnet

I have a CheckBox field in a GridView in an aspnet webform. Upon user checking / unchecking each checkbox, I want to run server side code for OnCheckedChanged event for that checkbox using jQuery. The GridView loads in a jQuery popup window like…
geoabram
  • 125
  • 2
  • 11
1
vote
5 answers

Clicking checkbox causes onCheckedChanged to fire twice

I have a GridView with a TemplateField with a checkbox. My goal is to capture the onclick event using autopostback and setting a database flag. My only problem is that the event fire's twice. The first time The Checkbox (In the sender parameter)…
minty
  • 22,235
  • 40
  • 89
  • 106
1
vote
0 answers

How do i get The answers selected in testFragment which is set in the customlistadapter?

This is my testfragment where i build the list based on a switch: public class TestFragment extends Fragment { public String Workshop; public int NumberOfQuestions; public Button SaveButton; public TextView GradeView; …
Igo
  • 11
  • 2
1
vote
3 answers

Show/Hide specific div if an input type checkbox has a value checked="checked" in it

I want to display/hide a div based on whether a certain checkbox is checked or unchecked. Please note this is not about using jQuery .click or .change function. These don't work in my case. What I am trying to do is that a certain div to display if…
bakar
  • 129
  • 1
  • 2
  • 11
1 2
3
8 9