Hi all, i'm trying to display a choice to send a text via email/sms.
public void onClick(View v) {
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, Body);
sendIntent.putExtra(Intent.EXTRA_SUBJECT,Title);
//sendIntent.setType("plain/text");
sendIntent.setType("message/rfc822");
try {
getContext().startActivity(Intent.createChooser(sendIntent,
getContext().getText(R.string.share_this_story)));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(getContext(), "Can't share",
Toast.LENGTH_SHORT).show
();
}
}
and it uses my gmail account as default for this action. I'd like to
have a dialog with options of
gmail, imap mail ( if setup) and messaging) ( kind of like share
pictures ). I thought that wrapping action_send in Chooser will give
me that. But i'm defaulting to gmail.
Permission to send sms is set.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---