Issue
How can I open email app in another screen "tab"?
When I send a reset link from my app, I just want to open the email app for the user. I don't want to call an Intent with the SENDTO action because the user will not be sending any mail
I just want to navigate user from my app to email app (received emails).
Solution
This worked for me
val launcher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.StartActivityForResult(),
onResult = { //Do something when user comes back in app }
)
Button(onClick = {
val intent = Intent(Intent.ACTION_MAIN).apply {
addCategory(Intent.CATEGORY_APP_EMAIL)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
launcher.launch(intent)
Answered By - EdoDo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.