From 73f886c23d043699141292c03c816eaa3c412ded Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Thu, 14 Apr 2022 17:34:32 +0530 Subject: [PATCH] Don't go to parent activity when back button is pressed in action bar --- .../e/accountmanager/ui/setup/CreateAccountActivity.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/foundation/e/accountmanager/ui/setup/CreateAccountActivity.kt b/app/src/main/java/foundation/e/accountmanager/ui/setup/CreateAccountActivity.kt index 351bc6aa2..9675622f9 100644 --- a/app/src/main/java/foundation/e/accountmanager/ui/setup/CreateAccountActivity.kt +++ b/app/src/main/java/foundation/e/accountmanager/ui/setup/CreateAccountActivity.kt @@ -9,6 +9,7 @@ package foundation.e.accountmanager.ui.setup import android.os.Bundle +import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity import foundation.e.accountmanager.R @@ -23,4 +24,12 @@ class CreateAccountActivity : AppCompatActivity() { commit() } } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (item.itemId == android.R.id.home) { + finish() + return true + } + return false + } } \ No newline at end of file -- GitLab