Stay organized with collections
Save and categorize content based on your preferences.
ChooserSession.StateListener
public
static
interface
ChooserSession.StateListener
android.service.chooser.ChooserSession.StateListener
|
A callback interface for Chooser session state updates.
Summary
Public methods |
abstract
void
|
onBoundsChanged(Rect bounds)
Gets invoked when the Chooser bounds are changed.
|
abstract
void
|
onStateChanged(int state)
Gets invoked when ChooserManager lifecycle state has changed.
|
Public methods
onBoundsChanged
public abstract void onBoundsChanged (Rect bounds)
Gets invoked when the Chooser bounds are changed. The rect parameter represents Chooser
window bounds in pixels.
Parameters |
bounds |
Rect : This value cannot be null . |
onStateChanged
public abstract void onStateChanged (int state)
Gets invoked when ChooserManager lifecycle state has changed.
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-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[],[],null,["# ChooserSession.StateListener\n\n[**Added in Android Baklava**](/preview) \n\nChooserSession.StateListener\n============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/service/chooser/ChooserSession.StateListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nChooserSession.StateListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------------|\n| android.service.chooser.ChooserSession.StateListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA callback interface for Chooser session state updates.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onBoundsChanged](/reference/android/service/chooser/ChooserSession.StateListener#onBoundsChanged(android.graphics.Rect))`(`[Rect](/reference/android/graphics/Rect)` bounds) ` Gets invoked when the Chooser bounds are changed. |\n| ` abstract void` | ` `[onStateChanged](/reference/android/service/chooser/ChooserSession.StateListener#onStateChanged(int))`(int state) ` Gets invoked when ChooserManager lifecycle state has changed. |\n\nPublic methods\n--------------\n\n### onBoundsChanged\n\n[**Added in Android Baklava**](/preview) \n\n```\npublic abstract void onBoundsChanged (Rect bounds)\n```\n\nGets invoked when the Chooser bounds are changed. The rect parameter represents Chooser\nwindow bounds in pixels.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|---------------------------------------------|\n| `bounds` | `Rect`: This value cannot be `null`. \u003cbr /\u003e |\n\n### onStateChanged\n\n[**Added in Android Baklava**](/preview) \n\n```\npublic abstract void onStateChanged (int state)\n```\n\nGets invoked when ChooserManager lifecycle state has changed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `state` | `int`: Value is [ChooserSession.STATE_INITIALIZED](/reference/android/service/chooser/ChooserSession#STATE_INITIALIZED), [ChooserSession.STATE_STARTED](/reference/android/service/chooser/ChooserSession#STATE_STARTED), or [ChooserSession.STATE_CLOSED](/reference/android/service/chooser/ChooserSession#STATE_CLOSED) \u003cbr /\u003e |"]]