@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.action_help) { ShareCompat.IntentBuilder.from(this) .setType("message/rfc822") .addEmailTo("pesiran@gmail.com") .setSubject("SunDatePicker") .startChooser(); } return super.onOptionsItemSelected(item); }
public static void sendMail(Activity activity, ReportMail reportMail, Uri fileUri) { Intent intent = ShareCompat.IntentBuilder.from(activity) .addEmailTo(reportMail.getEmail()) .setSubject(reportMail.getSubject()) .setText(reportMail.getBody()) .setType("text/plain") .setStream(fileUri) .getIntent() .addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); activity.startActivity(intent); }
/** * Creates an intent to prompt the user for sharing text. * * @param title The name of the text being stored. * @param url The url to be shared. * @param activity The current activity. */ public static Intent shareText(String title, String url, Activity activity) { return ShareCompat.IntentBuilder.from(activity) .setSubject(title) .setText(url) .setStream(Uri.parse(url)) .setType(TEXT_PLAIN_MIME) .setChooserTitle(R.string.share) .getIntent(); }
public static void openFeedback(Activity activity){ ShareCompat.IntentBuilder .from(activity) .setEmailTo(new String[]{"gigabytedevelopers@gmail.com"}) .setSubject("FireFiles Feedback" + getSuffix()) .setType("text/email") .setChooserTitle("Send Feedback") .startChooser(); }