Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
CompoundButton.OnCheckedChangeListener
android.widget.CompoundButton.OnCheckedChangeListener
|
Interface definition for a callback to be invoked when the checked state
of a compound button changed.
Summary
Public methods |
abstract
void
|
onCheckedChanged(CompoundButton buttonView, boolean isChecked)
Called when the checked state of a compound button has changed.
|
Public methods
public abstract void onCheckedChanged (CompoundButton buttonView,
boolean isChecked)
Called when the checked state of a compound button has changed.
Parameters |
buttonView |
CompoundButton : The compound button view whose state has changed.
This value cannot be null . |
isChecked |
boolean : The new checked state of buttonView. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CompoundButton.OnCheckedChangeListener\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nCompoundButton.OnCheckedChangeListener\n======================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/widget/CompoundButton.OnCheckedChangeListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nCompoundButton.OnCheckedChangeListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------|\n| android.widget.CompoundButton.OnCheckedChangeListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when the checked state\nof a compound button changed.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onCheckedChanged](/reference/android/widget/CompoundButton.OnCheckedChangeListener#onCheckedChanged(android.widget.CompoundButton,%20boolean))`(`[CompoundButton](/reference/android/widget/CompoundButton)` buttonView, boolean isChecked) ` Called when the checked state of a compound button has changed. |\n\nPublic methods\n--------------\n\n### onCheckedChanged\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onCheckedChanged (CompoundButton buttonView, \n boolean isChecked)\n```\n\nCalled when the checked state of a compound button has changed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------|\n| `buttonView` | `CompoundButton`: The compound button view whose state has changed. This value cannot be `null`. \u003cbr /\u003e |\n| `isChecked` | `boolean`: The new checked state of buttonView. \u003cbr /\u003e |"]]