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
2 answers

Changing textHint of an EditText depending on which radioButton is checked?

I am not sure if it is even possible but if it is I would appreciate your help! I need to change the textHint depending which radioButton is checked Radio Buttons. For example, I want the editText Hint to display "Miles" if the US radioButon is…
0
votes
1 answer

how to check radiobutton value when the next button is clicked

I'm in a situation where I have four radiobutton, next button and one question. now my issue is that if the user clicks next button without selecting any option it should show a toast message and if user clicks any one of the radio button, it…
Somasundaram NP
  • 1,018
  • 1
  • 12
  • 36
0
votes
1 answer

Changing TextView in a ListActivity when clicking checkbox (using CursurAdapter)

My issue is, that i can't solve to change the apperance of my TextView at the correct position, when I toggle a checkbox, which is part of a ListView. The goal is to STRIKE_THRU the text and (as the next step) give back the changed status to…
Joerch80
  • 1
  • 3
0
votes
1 answer

Updating data in the list within setOnCheckedChangeListener for BaseAdapter

I have following code: public class MyListAdapter extends BaseAdapter { private final List mItems = new ArrayList(); ... @Override public View getView(int position, View convertView, ViewGroup parent) { View…
Michael
  • 1,014
  • 2
  • 15
  • 26
0
votes
2 answers

I fixed my Android code but I want to know what was wrong with the old version

I have a listview containing checkbox and textview and I've added a ViewBinder to my adapter and in this viewbinder I've added an onchecked state listener to my checkboxes and in the onchecked state listener I wrote this…
0
votes
1 answer

ASP.NET / Sharepoint - Checkbox.CheckChanged event fires same Event of other (same) control from bevore

I'm working on a Webpart for SharePoint with ASP.NET On every click my page will be reloaded and I add a List of Checkboxes with different ID's in two tables and a event to handle the CheckedChanged Event (all the same). In Addition the autopostback…
Nicwin
  • 79
  • 1
  • 8
0
votes
2 answers

SharedPreferences getting deleted on app close

I have an app that uses SharedPreferences to keep track of the Users collection of items. But I've been getting complaints that they enter their items using a checkbox and when they restart the app their collection shows as empty. Here is the code…
Bill Gary
  • 2,987
  • 2
  • 15
  • 19
0
votes
0 answers

How to turn android switch on and then off with normal animation?

I would like to turn a switch on and then off. I have tried it this way: @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { swtch.setChecked(true); try { Thread.sleep(200); } catch…
Gizmo
  • 871
  • 1
  • 15
  • 38
0
votes
3 answers

Checked_Change Event of programatically generated Checkbox inside GridView Row

I have a GridView which holds user data. When the Page_Load Method is called, I get data using a DataTable and then bind it to the GridView. At the end of each row, I have added a CheckBox. This CB is used as a pointer for which entity the user…
LeonidasFett
  • 3,052
  • 4
  • 46
  • 76
0
votes
1 answer

nullpointer at OnCheckedChanged

I am getting a nullpointer exception at my onCheckedChanged listener. this is the code of my class: public class Instellingen extends PreferenceActivity implements OnCheckedChangeListener{ public static final int mode= Activity.MODE_PRIVATE; …
user
  • 121
  • 12
0
votes
1 answer

Modify Listview adapter rows when switch is on or off

I have ListView with row as TextView and Switch. Now I want that When I click on First Item Switch i.e. when I on the Switch(position==0) Then all Rows below that are Visible else When I make First Switch Off then all bellow Rows have to be removed…
0
votes
1 answer

CheckBox error on dialog interface

I'm struggling in a little problem that i can not find! In my main activity i want to display an AlertDialog and have a checkbox if the user do not want display the dialog again. I can make the dialog appear with the checkbox, etc.. but for some…
0
votes
1 answer

oncheckedchanged not firing for CheckBox when in GridView

I'm trying to have a OnCheckedChanged event fire for an asp:CheckBox which is within a GridView. But when I put it into a GridView it does not fire the OnCheckedChanged in the code-behind. If I put the same checkbox outside of the gridview, it's…
w1ck3d64
  • 402
  • 2
  • 8
  • 15
0
votes
1 answer

android: define RadioGroup onCheckChanged in XML

Was wondering if I could define the onCheckChanged method in the layout xml file in android for a RadioGroup? As it stands I have done this programmatically with rgroup.setOnCheckedChangeListener(this); followed by coding my onCheckedChanged()…
user1759942
  • 1,322
  • 4
  • 14
  • 33
0
votes
2 answers

Android - NullPointerException at setOnCheckedChangeListener

I'm trying to customize an AlertDialog by adding RadioButton and CheckBox to ask for information from users. However, the app crashes when loading the dialog and I get NullPointerException when adding setOnCheckedChangeListener to both radio buttons…
huong
  • 4,534
  • 6
  • 33
  • 54
1 2 3
8
9