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
0
votes
3 answers

What row index has a template checkbox in a datagrid?

I have a datagrid and there is a checkbox which is template in each row. Suppose I am in CheckedChanged event of one of the checkboxes. Is there any way I can tell in which row of the datagrid that check box is in?
Greg Oks
  • 2,700
  • 4
  • 35
  • 41
0
votes
1 answer

How can i have one switch on in a ListView of many switches?

I am building an Android app and I would like to have active only one switch in on-mode at any time in a ListView. I am using the onCheckedChanged method. How can I do this? public ListAdapter2(Context context, ArrayList resource, Boolean[]…
BillUser88
  • 127
  • 1
  • 3
  • 16
0
votes
1 answer

Clear radiogroup from another radiogroup in Android

I have two radio groups A and B.. If any one of the radio button in A is pressed, the checked button (if any) on B should be cleared, and vice-versa.. Also I need to show the value of select in selected. I have implemented something like…
OnePunchMan
  • 720
  • 15
  • 33
0
votes
1 answer

Several RadioButtons in a group unhandling event

If you have several radiobuttons in a group, and you have Checked event handlers in your code behind, if a radiobutton is checked how do you cancel this event handling so that the new radiobutton clicked does not get selected and your original…
urema
  • 721
  • 4
  • 11
  • 22
0
votes
1 answer

The difference between a Button and a RadioGroup in referencing

In an android Activity class, I saw the bridging to a Button of XML file and the setting it for click listener was using findViewById(): public class MyClass1 extends Activity implements OnClickListener { Button b; protected void…
0
votes
2 answers

OnCheckedChangeListener in ListView

I want to make a list view in that an item contains a text and a checkbox and for checkbox listener I want to use onCheckedChange. I didn't understand the behavior of this listener, because when I check an item from the top of the list and then I…
Popa Andrei
  • 2,299
  • 21
  • 25
0
votes
1 answer

setText in EditText throws a null pointer exception when called from a listener

I am trying to create an inverse of a lap counter. Each timer display (hh:mm:ss) is a linear layout made of edittexts. I have a counter (for lap counts) which is a linear layout with just 1 editText. I have a fragment which shows 2 timer layouts and…
0
votes
0 answers

issue on check boxes inside listview's every child item in android

I am working on check boxes in android, I had a listview with child having one checkbox, image, textviews and their respective onclick events. I blocked at selecting only one checkbox in the entire listview child at a time. if user wants to select…
0
votes
1 answer

Implementing OnCheckedChanged in Java

Basically in one fragment, I have 3 toggle buttons, therefore I decided that my interface should implement OnCheckedChange. These buttons are : date button, time button and now button. The work flow would be the following: date is pressed, date…
funkycookie
  • 226
  • 2
  • 16
0
votes
1 answer

OnCheckedChangeListener is not working for the check box

I am giving a check box to my action bar. this checkbox will be used to select all the items of my listactivity. butsetOnCheckedChangeListener is not working for this check box. I have created a seperate layout for my action bar and inflate it…
0
votes
2 answers

android input fields affect each other

In Android I have multiple form widgets in the same View and I'd like to have them affect each other. Right now I have an EditText field that you can type an integer into and I'd like to have the value show up in a series of ToggleButtons (i.e. the…
DruLang
  • 73
  • 4
0
votes
2 answers

CheckBox oncheckchanged event - button visible on checkbox check

I am having a problem with a CheckBox oncheckchanged event. The checkbox is in a gridview and I want a button to be visible if the checkbox is checked. The button becomes visible if one or more checkboxes are checked but the moment 1 checkbox is…
Aditya
  • 73
  • 9
0
votes
2 answers

OnCheckedChanged not firing when clicked

I'm trying to run my OnCheckedChanged inside an itemtemplate, but it is not firing. What I did was I typed the OnCheckChanged in the asp:CheckBox tag and also typed the entire method manually. Would this affect the process??
marchemike
  • 3,179
  • 13
  • 53
  • 96
0
votes
2 answers

setOnCheckedChangeListener

I want to expand the group item when I check on it, but for some reasons I can't collapse the group item after it expands. Can someone please tell me what I am doing wrong? public View getGroupView(final int groupPosition, boolean isExpanded,…
0
votes
1 answer

All radio group listeners called on click of any one radio button

RadioGroup r1 = (RadioGroup) view.findViewById(R.id.first); r1.setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(RadioGroup group, int checkedId) { …
KaR
  • 53
  • 1
  • 5
1 2 3
8 9