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
1
vote
1 answer

Function to return OnClickListener object in Android

So I made a little research trying to find a function to return an OnClickListener Object for a RadioGroup and one good lead was a question asked by "pedromateo" and a hopeful answer was given by "Guillaume" BUT I couldn't even find the function…
0
votes
5 answers

In asp.net, page_load occuring before radio button OnCheckedChanged event

I have two radio button on my asp.net page, with AutoPostBack = True When I click on either of those, they each set a flag SaveData=False However, when I click on them, the page_load event occurs first, so the page_load event saves the data, then…
Troy
  • 1,659
  • 4
  • 19
  • 33
0
votes
1 answer

OnCheckedChanged only fire at second click

I have two radio buttons that will determine the min value of the range validator of a textbox. So the radio buttons work well (resetting the min value on every CheckedChanged), except when the textbox display error message like "enter min value…
z-yee
  • 1
  • 1
0
votes
0 answers

Android RadioGroup clearCheck fires event onCheckedChanged

I have a fragment that is reloaded with data when the observer fires a change in viewmodel, so the fields in fragment should be reloaded. The fragment is not re instantiated, I just reload data from the onChange method in the observer. I have a…
Nicolas400
  • 563
  • 1
  • 7
  • 29
0
votes
2 answers

Toggle one button and untoggled other button

I'm learning Kotlin and I'm trying to make two buttons that can be toggled with the following characteristics: Button 1 starts as toggled(true) and button 2 starts as untoggled(false). If I click on the button that is untoggled, he becomes toggled…
random2137
  • 139
  • 2
  • 14
0
votes
1 answer

How to enable other checkboxes in recycler view if previous checkbox is checked (other checkboxes are disabled at first)?

What I want to do is if April and May have a due amount then a user cannot select May if April is not selected. First, a user has to select April then the May checkbox will get enabled. If May is selected then June will get enabled. I am not able to…
0
votes
1 answer

Attach OnCheckedChanged event to a div.onclick()

Is it possible to fire the OnCheckedChanged event of an ASP.NET checkbox to a div? So, when I click on the div, the OnCheckedChanged event should fire. The checkboxes are inside a repeater and the checkbox and a label are surrounded by a div. Is…
0
votes
1 answer

Button only enable when texts are filled and button checked

I'm basically setting up a info collection activity. It has a radio group for the gender choice and edit texts for name and age. I have implemented both the onCheckedChangeListener for the radio group and the textChangedListener for the edit texts…
Dendi Maniac
  • 69
  • 1
  • 6
0
votes
2 answers

Dynamically added RadioButtons do not listen to onCheckChangedListener()

I need to add RadioGroups and RadioButtons dynamically and generate desired view and implement onCheckChangedListener() on my dynamically created RadioGroup . The problem is, when a newly added button is checked, it is not unchecked when I am…
Kartik Saraf
  • 115
  • 1
  • 8
0
votes
1 answer

SwitchCompat OnCheckedChangeListener called on every orientation change of Fragment

I have an activity which hosts a fragment and the problem is that, on every orientation change and only if the switch was in the checked state, the OnCheckedChangeListener is called. How do I solve this problem? Thanks! MainActivity.java: public…
0
votes
1 answer

SQLite seems not to be executed in Android RecyclerView with onCheckedChanged

I have a list inflated by a RecyclerView, which is extracted by an SQLite database. I use a onCheckedChanged to manipulate the data. If I click the CheckBox, method setItem() is called. private void setItem(int position, boolean checked) { …
Martin
  • 506
  • 1
  • 5
  • 12
0
votes
1 answer

OnCheckedChanged event not being triggered when checbox unchecked

I am trying to implement a checkbox logic. When the checkbox is checked the textbox will be enabled and vice versa. When the checkbox checked, the event is triggered. However when the checkbox is unchecked, the event isn't triggered. Here are the…
GAD
  • 27
  • 6
0
votes
1 answer

YUI Radiobutton ASP.Net oncheckedchanged

I'm using YUI framework to style my radiobuttons and want to use the oncheckedchanged event to redirect to another page. It works just fine with traditional radiobuttons but using with the YUI framework the oncheckedchanged event never fires. Almost…
0
votes
1 answer

Checkbox OnCheckedChange event with postback?

I have a gridview with checkbox controls as columns and with Autopostback='true' for inserting to db. Everyting works fine except when i "change pages" - Postback (?) My checked checkboxes gets unchecked when I go back to the page. My Page_Load…
Nils
  • 516
  • 3
  • 9
  • 33
1 2 3
8 9