Ive been using the recommended way to populate an email intent since the early days of Android. This includes recipient, subject, and body text.
On Android 12 however - the recipient field is always left out when doing this, everything else works exactly the same.
Whats is the issue here? Is this a bug in the OS? Im testing with gmail by default, but the same thing applies to other email clients, still only on Android 12.
private fun createIntent(
metadata: String
): Intent {
val uri = Uri.parse("mailto:")
return Intent(ACTION_SENDTO)
.setData(uri)
.putExtra(
EXTRA_EMAIL,
arrayOf("example@gmail.com") //Ive also tried without arrayOf, no difference.
)
.putExtra(
EXTRA_SUBJECT,
"Feedback"
)
.putExtra(
EXTRA_TEXT,
metadata
)
}