Exemplo n.º 1
0
  /**
   * Defines a default (dummy) share intent to initialize the action provider. However, as soon as
   * the actual content to be used in the intent is known or changes, you must update the share
   * intent by again calling mShareActionProvider.setShareIntent()
   */
  private Intent updateShareIntent() {
    if (null == appPreference) {
      return null;
    }

    final String text =
        String.format(getString(R.string.share_text_full_total), appPreference.getTotalNumber());
    takeScreenshot();
    Intent intent =
        Utils.getShareIntent(
            MainActivity.this, MainActivity.this.getString(R.string.app_name), text, shareFileName);

    if (null != mShareActionProvider) {
      //            mShareActionProvider.setShareIntent(Utils.getShareRawIntent(this));
      mShareActionProvider.setShareIntent(intent);
    }

    return intent;
  }