/** * Sets the file name of a file for persisting the share history which * history will be used for ordering share targets. This file will be used * for all view created by {@link #onCreateActionView()}. Defaults to * {@link #DEFAULT_SHARE_HISTORY_FILE_NAME}. Set to <code>null</code> * if share history should not be persisted between sessions. * <p> * <strong>Note:</strong> The history file name can be set any time, however * only the action views created by {@link #onCreateActionView()} after setting * the file name will be backed by the provided file. Therefore, if you want to * use different history files for sharing specific types of content, every time * you change the history file {@link #setShareHistoryFileName(String)} you must * 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> * private void doShare(Intent intent) { * if (IMAGE.equals(intent.getMimeType())) { * mShareActionProvider.setHistoryFileName(SHARE_IMAGE_HISTORY_FILE_NAME); * } else if (TEXT.equals(intent.getMimeType())) { * mShareActionProvider.setHistoryFileName(SHARE_TEXT_HISTORY_FILE_NAME); * } * mShareActionProvider.setIntent(intent); * invalidateOptionsMenu(); * } * <code> * * @param shareHistoryFile The share history file name. */ @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-09-18 21:46:52.214 -0400", hash_original_method = "55B9AB4A16F0F7764FD2AA524BC9ED0A", hash_generated_method = "03E0DA1D52ECA62A54D2669894C69150") public void setShareHistoryFileName(String shareHistoryFile) { mShareHistoryFileName = shareHistoryFile; setActivityChooserPolicyIfNeeded(); }
/** * Sets a listener to be notified when a share target has been selected. The listener can * optionally decide to handle the selection and not rely on the default behavior which is to * launch the activity. * * <p><strong>Note:</strong> If you choose the backing share history file you will still be * notified in this callback. * * @param listener The listener. */ @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-09-18 21:46:52.203 -0400", hash_original_method = "AF132A5C7109C48F5C74FEA83B1BA0C7", hash_generated_method = "B8FE842239AA363CF03B3737C8FA23CD") public void setOnShareTargetSelectedListener(OnShareTargetSelectedListener listener) { mOnShareTargetSelectedListener = listener; setActivityChooserPolicyIfNeeded(); }
public void setOnShareTargetSelectedListener(OnShareTargetSelectedListener listener) { this.mOnShareTargetSelectedListener = listener; setActivityChooserPolicyIfNeeded(); }
public void setShareHistoryFileName(String shareHistoryFile) { this.mShareHistoryFileName = shareHistoryFile; setActivityChooserPolicyIfNeeded(); }