Skip to content

Commit

Permalink
Exclude first intent in extra launch intents
Browse files Browse the repository at this point in the history
  • Loading branch information
tung2744 committed Dec 1, 2023
1 parent 3effdf6 commit 322b9dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/src/main/java/com/oursky/authgear/latte/EmailClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ data class EmailClient(val packageName: String) {
}
val firstIntent = launchIntents[0]
val chooser = Intent.createChooser(firstIntent, title)
chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, launchIntents.toTypedArray())
var extraIntents = mutableListOf<Intent>()
if (launchIntents.size > 1) {
extraIntents = launchIntents.subList(1, launchIntents.size)
}
chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents.toTypedArray())
chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return chooser
}
Expand Down

0 comments on commit 322b9dc

Please sign in to comment.