diff options
| author | 2012-04-13 12:35:31 -0700 | |
|---|---|---|
| committer | 2012-04-13 12:35:31 -0700 | |
| commit | c6afc7a7e0131f9186434604ba92adc37ce7196d (patch) | |
| tree | 0abe2d954dbfcde5866b215ccd94c641c761cc1e | |
| parent | cedb16ea03d58f33510c399df5b68b791fccaf95 (diff) | |
| parent | b33eacdb791e569ebb429b55d7ab098973e19764 (diff) | |
Merge "Ignore the result of the on share callback in ShareActionProvider."
| -rw-r--r-- | core/java/android/widget/ShareActionProvider.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/widget/ShareActionProvider.java b/core/java/android/widget/ShareActionProvider.java index 22e9ef1357e8..080b87db13c1 100644 --- a/core/java/android/widget/ShareActionProvider.java +++ b/core/java/android/widget/ShareActionProvider.java @@ -80,16 +80,22 @@ public class ShareActionProvider extends ActionProvider { /** * Called when a share target has been selected. The client can - * decide whether to handle the intent or rely on the default - * behavior which is launching it. + * decide whether to perform some action before the sharing is + * actually performed. * <p> * <strong>Note:</strong> Modifying the intent is not permitted and * any changes to the latter will be ignored. * </p> + * <p> + * <strong>Note:</strong> You should <strong>not</strong> 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. + * </p> * * @param source The source of the notification. * @param intent The intent for launching the chosen share target. - * @return Whether the client has handled the intent. + * @return The return result is ignored. Always return false for consistency. */ public boolean onShareTargetSelected(ShareActionProvider source, Intent intent); } @@ -308,7 +314,7 @@ public class ShareActionProvider extends ActionProvider { @Override public boolean onChooseActivity(ActivityChooserModel host, Intent intent) { if (mOnShareTargetSelectedListener != null) { - return mOnShareTargetSelectedListener.onShareTargetSelected( + mOnShareTargetSelectedListener.onShareTargetSelected( ShareActionProvider.this, intent); } return false; |