Skip to content
Advertisement

Android Studio mailto Intent doesn’t show subject and mail body

I’m trying to send an e-mail from my Android App. With the click on a button, gmail should open and show a new email with my previously defined recipient, subject and email body. So far I’ve tried sending the Intent.ACTION_VIEW as well as Intent.ACTION_SENDTO. Both show my draft with the recipient only. Both subject and message are being opressed. Weird thing is when using the emulator, it works just fine. Also was trying to lock at the android errorlog. Seems like i don’t have permission. Is it really a permission problem or could it be something else? I’d really appreciate any help cheers

Here is my code:

  • sending email via ACTION_VIEW
JavaScript
  • sending email via ACTION_SENDTO
JavaScript
  • error message from logcat
JavaScript

Advertisement

Answer

try out this code, it worked for me.

JavaScript

also add intent filter in android manifest.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement