Exemplo n.º 1
0
  private static void quoteTweet(Context context, Status status) {
    String appendText =
        String.format(
            FeaturePatternUtils.getRetweetFormat(status.getServiceProvider()),
            FeaturePatternUtils.getRetweetSeparator(status.getServiceProvider()),
            status.getUser().getMentionName(),
            status.getText());

    Status retweet = status.getRetweetedStatus();
    if (retweet != null) {
      // 官方RT形成的微博结构,引用推文时不再插入RT,因为上面的status.getText()就是RT
      appendText +=
          String.format(
              FeaturePatternUtils.getRetweetFormat(status.getServiceProvider()),
              "",
              retweet.getUser().getMentionName(),
              retweet.getText());
    }

    Intent intent = new Intent();
    intent.putExtra("TYPE", Constants.EDIT_TYPE_RETWEET);
    intent.putExtra("APPEND_TEXT", appendText);

    intent.setClass(context, EditMicroBlogActivity.class);
    ((Activity) context).startActivity(intent);
  }