1

I have an activity (B) that does a 'Intent.ACTION_SEND' to send a email with a image attached.

It works perfect, but when the email is sended, it returns to B, as is supossed to be. But I want to "jump" to activity A.

Usually I manage it with startActivityForResult --> onActivityResult. But in this case I can't do because my startActivity has a chooser (saw examples at google dev pages):

Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.putExtra(Intent.EXTRA_EMAIL, toSender);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subjectText);
emailIntent.putExtra(Intent.EXTRA_TEXT, "");

emailIntent.setType("image/jpeg");
Uri fileUri = Uri.fromFile(imageFile);
emailIntent.putExtra(Intent.EXTRA_STREAM, fileUri);

startActivity(Intent.createChooser(emailIntent, "Send the email in:"));

So my question is how can I manage to jump to other activity after the email has been send?

Shudy
  • 7,806
  • 19
  • 63
  • 98
  • might be an option to wrap your functionality into a fragment, and display another fragment once you come back, because this way you should be able to use startActivityForResult. I havent tried this, but from the top of my head that should work. – Daniel Bo Sep 01 '15 at 12:20

1 Answers1

0

This answers your question, what you're looking for is

startActivityForResult 
Community
  • 1
  • 1
Bisho Adam
  • 191
  • 1
  • 2
  • 12