Stay organized with collections
Save and categorize content based on your preferences.
EmbeddedPhotoPickerClient
public
interface
EmbeddedPhotoPickerClient
android.widget.photopicker.EmbeddedPhotoPickerClient
|
Callback to define mechanisms by which can apps can receive notifications about
different events from embedded photopicker for the corresponding Session
(EmbeddedPhotoPickerSession
).
PhotoPicker will invoke the methods of this interface on the Executor provided by
the caller in EmbeddedPhotoPickerProvider.openSession
Any methods on a single instance of this object will always be invoked in a non-concurrent
or thread safe way. In other words, all methods are invoked in a serial execution manner
on the executor passed by the caller. Hence callers wouldn't need any buffer or locking
mechanism on their end.
Summary
Public methods
onSelectionComplete
public abstract void onSelectionComplete ()
Reports that the user is done with their selection and should collapse the picker.
This doesn't necessarily mean that the session should be closed, but rather the user
has indicated that they are done selecting images and should go back to the app.
onSessionError
public abstract void onSessionError (Throwable cause)
Reports that terminal error has occurred in the session. Any further events
notified on this session will be ignored. The embedded photopicker view will be
torn down along with session upon error.
Parameters |
cause |
Throwable : This value cannot be null . |
public abstract void onSessionOpened (EmbeddedPhotoPickerSession session)
Reports that session of app with photopicker was established successfully.
Also shares EmbeddedPhotoPickerSession
handle containing the view
with the caller that should be used to notify the session of UI events.
Parameters |
session |
EmbeddedPhotoPickerSession : This value cannot be null . |
onUriPermissionGranted
public abstract void onUriPermissionGranted (List<Uri> uris)
Reports that URI permission has been granted to the item selected by the user.
It is possible that the permission to the URI was revoked if the item was unselected
by user before the URI is actually accessed by the caller. Hence callers must
handle SecurityException
when attempting to read or use the URI in
response to this callback.
Parameters |
uris |
List : This value cannot be null . |
onUriPermissionRevoked
public abstract void onUriPermissionRevoked (List<Uri> uris)
Reports that URI permission has been revoked of the item deselected by the
user.
Parameters |
uris |
List : This value cannot be null . |
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-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# EmbeddedPhotoPickerClient\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\nEmbeddedPhotoPickerClient\n=========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/widget/photopicker/EmbeddedPhotoPickerClient \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nEmbeddedPhotoPickerClient\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------------|\n| android.widget.photopicker.EmbeddedPhotoPickerClient |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback to define mechanisms by which can apps can receive notifications about\ndifferent events from embedded photopicker for the corresponding Session\n([EmbeddedPhotoPickerSession](/reference/android/widget/photopicker/EmbeddedPhotoPickerSession)).\n\nPhotoPicker will invoke the methods of this interface on the Executor provided by\nthe caller in [EmbeddedPhotoPickerProvider.openSession](/reference/android/widget/photopicker/EmbeddedPhotoPickerProvider#openSession(android.os.IBinder,%20int,%20int,%20int,%20android.widget.photopicker.EmbeddedPhotoPickerFeatureInfo,%20java.util.concurrent.Executor,%20android.widget.photopicker.EmbeddedPhotoPickerClient))\n\nAny methods on a single instance of this object will always be invoked in a non-concurrent\nor thread safe way. In other words, all methods are invoked in a serial execution manner\non the executor passed by the caller. Hence callers wouldn't need any buffer or locking\nmechanism on their end. \n**See also:**\n\n- [EmbeddedPhotoPickerProvider](/reference/android/widget/photopicker/EmbeddedPhotoPickerProvider)\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onSelectionComplete](/reference/android/widget/photopicker/EmbeddedPhotoPickerClient#onSelectionComplete())`() ` Reports that the user is done with their selection and should collapse the picker. |\n| ` abstract void` | ` `[onSessionError](/reference/android/widget/photopicker/EmbeddedPhotoPickerClient#onSessionError(java.lang.Throwable))`(`[Throwable](/reference/java/lang/Throwable)` cause) ` Reports that terminal error has occurred in the session. |\n| ` abstract void` | ` `[onSessionOpened](/reference/android/widget/photopicker/EmbeddedPhotoPickerClient#onSessionOpened(android.widget.photopicker.EmbeddedPhotoPickerSession))`(`[EmbeddedPhotoPickerSession](/reference/android/widget/photopicker/EmbeddedPhotoPickerSession)` session) ` Reports that session of app with photopicker was established successfully. |\n| ` abstract void` | ` `[onUriPermissionGranted](/reference/android/widget/photopicker/EmbeddedPhotoPickerClient#onUriPermissionGranted(java.util.List\u003candroid.net.Uri\u003e))`(`[List](/reference/java/util/List)`\u003c`[Uri](/reference/android/net/Uri)`\u003e uris) ` Reports that URI permission has been granted to the item selected by the user. |\n| ` abstract void` | ` `[onUriPermissionRevoked](/reference/android/widget/photopicker/EmbeddedPhotoPickerClient#onUriPermissionRevoked(java.util.List\u003candroid.net.Uri\u003e))`(`[List](/reference/java/util/List)`\u003c`[Uri](/reference/android/net/Uri)`\u003e uris) ` Reports that URI permission has been revoked of the item deselected by the user. |\n\nPublic methods\n--------------\n\n### onSelectionComplete\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\n```\npublic abstract void onSelectionComplete ()\n```\n\nReports that the user is done with their selection and should collapse the picker.\n\nThis doesn't necessarily mean that the session should be closed, but rather the user\nhas indicated that they are done selecting images and should go back to the app.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### onSessionError\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\n```\npublic abstract void onSessionError (Throwable cause)\n```\n\nReports that terminal error has occurred in the session. Any further events\nnotified on this session will be ignored. The embedded photopicker view will be\ntorn down along with session upon error.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------|\n| `cause` | `Throwable`: This value cannot be `null`. \u003cbr /\u003e |\n\n### onSessionOpened\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\n```\npublic abstract void onSessionOpened (EmbeddedPhotoPickerSession session)\n```\n\nReports that session of app with photopicker was established successfully.\nAlso shares [EmbeddedPhotoPickerSession](/reference/android/widget/photopicker/EmbeddedPhotoPickerSession) handle containing the view\nwith the caller that should be used to notify the session of UI events.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------|\n| `session` | `EmbeddedPhotoPickerSession`: This value cannot be `null`. \u003cbr /\u003e |\n\n### onUriPermissionGranted\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\n```\npublic abstract void onUriPermissionGranted (List\u003cUri\u003e uris)\n```\n\nReports that URI permission has been granted to the item selected by the user.\n\nIt is possible that the permission to the URI was revoked if the item was unselected\nby user before the URI is actually accessed by the caller. Hence callers must\nhandle `SecurityException` when attempting to read or use the URI in\nresponse to this callback.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|---------------------------------------------|\n| `uris` | `List`: This value cannot be `null`. \u003cbr /\u003e |\n\n### onUriPermissionRevoked\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [U Extensions 15](/sdkExtensions) \n\n```\npublic abstract void onUriPermissionRevoked (List\u003cUri\u003e uris)\n```\n\nReports that URI permission has been revoked of the item deselected by the\nuser.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|---------------------------------------------|\n| `uris` | `List`: This value cannot be `null`. \u003cbr /\u003e |"]]