Stay organized with collections
Save and categorize content based on your preferences.
ShareActionProvider.OnShareTargetSelectedListener
public
static
interface
ShareActionProvider.OnShareTargetSelectedListener
android.widget.ShareActionProvider.OnShareTargetSelectedListener
|
Listener for the event of selecting a share target.
Summary
Public methods
onShareTargetSelected
public abstract boolean onShareTargetSelected (ShareActionProvider source,
Intent intent)
Called when a share target has been selected. The client can
decide whether to perform some action before the sharing is
actually performed.
Note: Modifying the intent is not permitted and
any changes to the latter will be ignored.
Note: You should not handle the
intent here. This callback aims to notify the client that a
sharing is being performed, so the client can update the UI
if necessary.
Parameters |
source |
ShareActionProvider : The source of the notification. |
intent |
Intent : The intent for launching the chosen share target. |
Returns |
boolean |
The return result is ignored. Always return false for consistency. |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ShareActionProvider.OnShareTargetSelectedListener\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nShareActionProvider.OnShareTargetSelectedListener\n=================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/widget/ShareActionProvider.OnShareTargetSelectedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nShareActionProvider.OnShareTargetSelectedListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------------------------|\n| android.widget.ShareActionProvider.OnShareTargetSelectedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListener for the event of selecting a share target.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onShareTargetSelected](/reference/android/widget/ShareActionProvider.OnShareTargetSelectedListener#onShareTargetSelected(android.widget.ShareActionProvider,%20android.content.Intent))`(`[ShareActionProvider](/reference/android/widget/ShareActionProvider)` source, `[Intent](/reference/android/content/Intent)` intent) ` Called when a share target has been selected. |\n\nPublic methods\n--------------\n\n### onShareTargetSelected\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onShareTargetSelected (ShareActionProvider source, \n Intent intent)\n```\n\nCalled when a share target has been selected. The client can\ndecide whether to perform some action before the sharing is\nactually performed.\n\n\n**Note:** Modifying the intent is not permitted and\nany changes to the latter will be ignored.\n\n\n**Note:** You should **not** handle the\nintent here. This callback aims to notify the client that a\nsharing is being performed, so the client can update the UI\nif necessary.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|--------------------------------------------------------------------|\n| `source` | `ShareActionProvider`: The source of the notification. \u003cbr /\u003e |\n| `intent` | `Intent`: The intent for launching the chosen share target. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|---------------------------------------------------------------------------|\n| `boolean` | The return result is ignored. Always return false for consistency. \u003cbr /\u003e |"]]