stellarowl12
stellarowl12

Reputation: 525

Going BACK to app after email intent brings you to email client

So I'm able to get my email intent working. I have a button that I press and it allows me to choose my email client and then it takes me to the client I press.

My problem though is when I press my smartphone's "back" button, it either takes me back to the main feed of my email client or back to the home screen of my phone...

How do I get it to go back to my actual app? Preferably where it was right before it went to the email client?

Thanks in advance!

Upvotes: 1

Views: 862

Answers (2)

stellarowl12
stellarowl12

Reputation: 525

Rookie mistake, you aren't supposed call the method finish() in your onAttach function...

Upvotes: 1

Ziad Halabi
Ziad Halabi

Reputation: 866

It is not possible. Check this answer: Email intent back to activity

You might want to implement an IMAP Protocol in your app in order to send the email inside the app without needing for an intent to open an email sharing app.

This will help you build your own email sending in your app using JavaMail API Sending Email in Android using JavaMail API without using the default/built-in app

Upvotes: 0

Related Questions