Stay organized with collections
Save and categorize content based on your preferences.
MultiChoiceModeListener
interface MultiChoiceModeListener : ActionMode.Callback
A MultiChoiceModeListener receives events for AbsListView.CHOICE_MODE_MULTIPLE_MODAL
. It acts as the ActionMode.Callback
for the selection mode and also receives onItemCheckedStateChanged(android.view.ActionMode,int,long,boolean)
events when the user selects and deselects list items.
Summary
Public methods |
abstract Unit |
Called when an item is checked or unchecked during selection mode.
|
Public methods
onItemCheckedStateChanged
abstract fun onItemCheckedStateChanged(
mode: ActionMode!,
position: Int,
id: Long,
checked: Boolean
): Unit
Called when an item is checked or unchecked during selection mode.
Parameters |
mode |
ActionMode!: The ActionMode providing the selection mode |
position |
Int: Adapter position of the item that was checked or unchecked |
id |
Long: Adapter ID of the item that was checked or unchecked |
checked |
Boolean: true if the item is now checked, false if the item is now unchecked. |
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,["# AbsListView.MultiChoiceModeListener\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMultiChoiceModeListener\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/AbsListView.MultiChoiceModeListener \"View this page in Java\") \n\n```\ninterface MultiChoiceModeListener : ActionMode.Callback\n```\n\n|---------------------------------------------------------|\n| [android.widget.AbsListView.MultiChoiceModeListener](#) |\n\nA MultiChoiceModeListener receives events for [AbsListView.CHOICE_MODE_MULTIPLE_MODAL](/reference/kotlin/android/widget/AbsListView#CHOICE_MODE_MULTIPLE_MODAL:kotlin.Int). It acts as the [ActionMode.Callback](../view/ActionMode.Callback.html#) for the selection mode and also receives [onItemCheckedStateChanged(android.view.ActionMode,int,long,boolean)](#onItemCheckedStateChanged(android.view.ActionMode,%20kotlin.Int,%20kotlin.Long,%20kotlin.Boolean)) events when the user selects and deselects list items.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onItemCheckedStateChanged](#onItemCheckedStateChanged(android.view.ActionMode,%20kotlin.Int,%20kotlin.Long,%20kotlin.Boolean))`(`mode:` `[ActionMode](../view/ActionMode.html#)!`, `position:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `id:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `checked:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when an item is checked or unchecked during selection mode. |\n\n| Inherited functions ||\n|---|---|\n| From class [Callback](../view/ActionMode.Callback.html#) |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onActionItemClicked](../view/ActionMode.Callback.html#onActionItemClicked(android.view.ActionMode,%20android.view.MenuItem))`(`mode:` `[ActionMode](../view/ActionMode.html#)!`, `item:` `[MenuItem](../view/MenuItem.html#)!`)` Called to report a user click on an action button. \u003cbr /\u003e | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onCreateActionMode](../view/ActionMode.Callback.html#onCreateActionMode(android.view.ActionMode,%20android.view.Menu))`(`mode:` `[ActionMode](../view/ActionMode.html#)!`, `menu:` `[Menu](../view/Menu.html#)!`)` Called when action mode is first created. The menu supplied will be used to generate action buttons for the action mode. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDestroyActionMode](../view/ActionMode.Callback.html#onDestroyActionMode(android.view.ActionMode))`(`mode:` `[ActionMode](../view/ActionMode.html#)!`)` Called when an action mode is about to be exited and destroyed. \u003cbr /\u003e | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onPrepareActionMode](../view/ActionMode.Callback.html#onPrepareActionMode(android.view.ActionMode,%20android.view.Menu))`(`mode:` `[ActionMode](../view/ActionMode.html#)!`, `menu:` `[Menu](../view/Menu.html#)!`)` Called to refresh an action mode's action menu whenever it is invalidated. \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### onItemCheckedStateChanged\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onItemCheckedStateChanged(\n mode: ActionMode!, \n position: Int, \n id: Long, \n checked: Boolean\n): Unit\n```\n\nCalled when an item is checked or unchecked during selection mode.\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mode` | [ActionMode](../view/ActionMode.html#)!: The [ActionMode](../view/ActionMode.html#) providing the selection mode |\n| `position` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Adapter position of the item that was checked or unchecked |\n| `id` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): Adapter ID of the item that was checked or unchecked |\n| `checked` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): `true` if the item is now checked, `false` if the item is now unchecked. |"]]