Loading core/java/android/widget/ShareActionProvider.java +26 −38 Original line number Diff line number Diff line Loading @@ -39,9 +39,7 @@ import com.android.internal.R; * <p> * Here is how to use the action provider with custom backing file in a {@link MenuItem}: * </p> * <p> * <pre> * <code> * // In Activity#onCreateOptionsMenu * public boolean onCreateOptionsMenu(Menu menu) { * // Get the menu item. Loading @@ -60,10 +58,7 @@ import com.android.internal.R; * public void doShare(Intent shareIntent) { * // When you want to share set the share intent. * mShareActionProvider.setShareIntent(shareIntent); * } * </pre> * </code> * </p> * }</pre> * <p> * <strong>Note:</strong> While the sample snippet demonstrates how to use this provider * in the context of a menu item, the use of the provider is not limited to menu items. Loading Loading @@ -245,9 +240,9 @@ public class ShareActionProvider extends ActionProvider { * call {@link android.app.Activity#invalidateOptionsMenu()} to recreate the * action view. You should <strong>not</strong> call * {@link android.app.Activity#invalidateOptionsMenu()} from * {@link android.app.Activity#onCreateOptionsMenu(Menu)}." * <p> * <code> * {@link android.app.Activity#onCreateOptionsMenu(Menu)}. * </p> * <pre> * private void doShare(Intent intent) { * if (IMAGE.equals(intent.getMimeType())) { * mShareActionProvider.setHistoryFileName(SHARE_IMAGE_HISTORY_FILE_NAME); Loading @@ -256,9 +251,7 @@ public class ShareActionProvider extends ActionProvider { * } * mShareActionProvider.setIntent(intent); * invalidateOptionsMenu(); * } * <code> * * }</pre> * @param shareHistoryFile The share history file name. */ public void setShareHistoryFileName(String shareHistoryFile) { Loading @@ -269,16 +262,11 @@ public class ShareActionProvider extends ActionProvider { /** * Sets an intent with information about the share action. Here is a * sample for constructing a share intent: * <p> * <pre> * <code> * Intent shareIntent = new Intent(Intent.ACTION_SEND); * shareIntent.setType("image/*"); * Uri uri = Uri.fromFile(new File(getFilesDir(), "foo.jpg")); * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString()); * </pre> * </code> * </p> * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());</pre> * * @param shareIntent The share intent. * Loading Loading
core/java/android/widget/ShareActionProvider.java +26 −38 Original line number Diff line number Diff line Loading @@ -39,9 +39,7 @@ import com.android.internal.R; * <p> * Here is how to use the action provider with custom backing file in a {@link MenuItem}: * </p> * <p> * <pre> * <code> * // In Activity#onCreateOptionsMenu * public boolean onCreateOptionsMenu(Menu menu) { * // Get the menu item. Loading @@ -60,10 +58,7 @@ import com.android.internal.R; * public void doShare(Intent shareIntent) { * // When you want to share set the share intent. * mShareActionProvider.setShareIntent(shareIntent); * } * </pre> * </code> * </p> * }</pre> * <p> * <strong>Note:</strong> While the sample snippet demonstrates how to use this provider * in the context of a menu item, the use of the provider is not limited to menu items. Loading Loading @@ -245,9 +240,9 @@ public class ShareActionProvider extends ActionProvider { * call {@link android.app.Activity#invalidateOptionsMenu()} to recreate the * action view. You should <strong>not</strong> call * {@link android.app.Activity#invalidateOptionsMenu()} from * {@link android.app.Activity#onCreateOptionsMenu(Menu)}." * <p> * <code> * {@link android.app.Activity#onCreateOptionsMenu(Menu)}. * </p> * <pre> * private void doShare(Intent intent) { * if (IMAGE.equals(intent.getMimeType())) { * mShareActionProvider.setHistoryFileName(SHARE_IMAGE_HISTORY_FILE_NAME); Loading @@ -256,9 +251,7 @@ public class ShareActionProvider extends ActionProvider { * } * mShareActionProvider.setIntent(intent); * invalidateOptionsMenu(); * } * <code> * * }</pre> * @param shareHistoryFile The share history file name. */ public void setShareHistoryFileName(String shareHistoryFile) { Loading @@ -269,16 +262,11 @@ public class ShareActionProvider extends ActionProvider { /** * Sets an intent with information about the share action. Here is a * sample for constructing a share intent: * <p> * <pre> * <code> * Intent shareIntent = new Intent(Intent.ACTION_SEND); * shareIntent.setType("image/*"); * Uri uri = Uri.fromFile(new File(getFilesDir(), "foo.jpg")); * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString()); * </pre> * </code> * </p> * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());</pre> * * @param shareIntent The share intent. * Loading