code: public static Intent shareText(String subject, String text) {
          Intent intent = new Intent();
          intent.setAction(Intent.ACTION_SEND);
          if (!TextUtils.isEmpty(subject)) {
              intent.putExtra(Intent.EXTRA_SUBJECT, subject);
          }
          intent.putExtra(Intent.EXTRA_TEXT, text);
          intent.setType("text/plain");
          return intent;
      }
docs: Share text via thirdparty app like twitter, facebook, email, sms etc.
  
  @param subject Optional subject of the message
  @param text    Text to share