When launching intro, going back closes the app

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
This commit is contained in:
Arnau Mora 2024-06-15 09:02:34 +02:00 committed by Ricki Hirner
parent 1550c41a18
commit 3aa205c3c3

View File

@ -68,7 +68,9 @@ class IntroActivity : AppCompatActivity() {
*/
object Contract: ActivityResultContract<Unit?, Boolean>() {
override fun createIntent(context: Context, input: Unit?): Intent =
Intent(context, IntroActivity::class.java)
Intent(context, IntroActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
override fun parseResult(resultCode: Int, intent: Intent?): Boolean {
return resultCode == Activity.RESULT_CANCELED