From 54c7bd1bf0938dcbee81f3accd58e5deed563830 Mon Sep 17 00:00:00 2001 From: Ayush Date: Mon, 21 Oct 2024 23:05:20 +0530 Subject: [PATCH 1/5] Fix: Use finish() instead of intent for smoother navigation (#3641) --- .../org/oppia/android/app/profile/AddProfileActivity.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/profile/AddProfileActivity.kt b/app/src/main/java/org/oppia/android/app/profile/AddProfileActivity.kt index 1acff5fd581..8b9bcf3bbca 100644 --- a/app/src/main/java/org/oppia/android/app/profile/AddProfileActivity.kt +++ b/app/src/main/java/org/oppia/android/app/profile/AddProfileActivity.kt @@ -4,13 +4,13 @@ import android.content.Context import android.content.Intent import android.os.Bundle import androidx.activity.result.contract.ActivityResultContracts +import javax.inject.Inject import org.oppia.android.app.activity.ActivityComponentImpl import org.oppia.android.app.activity.InjectableAutoLocalizedAppCompatActivity import org.oppia.android.app.model.AddProfileActivityParams import org.oppia.android.app.model.ScreenName.ADD_PROFILE_ACTIVITY import org.oppia.android.util.extensions.putProtoExtra import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName -import javax.inject.Inject /** Activity that allows users to create new profiles. */ class AddProfileActivity : InjectableAutoLocalizedAppCompatActivity() { @@ -44,10 +44,7 @@ class AddProfileActivity : InjectableAutoLocalizedAppCompatActivity() { } override fun onSupportNavigateUp(): Boolean { - // TODO(#3641): Investigate on using finish instead of intent. - val intent = Intent(this, ProfileChooserActivity::class.java) - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - startActivity(intent) + finish() return false } From 32b1dca2dcbb2e2ace78b788b850f46a8230b9a9 Mon Sep 17 00:00:00 2001 From: Ayush Date: Mon, 28 Oct 2024 19:56:25 +0530 Subject: [PATCH 2/5] Removed TODO --- .idea/codeStyles/Project.xml | 4 +--- .../org/oppia/android/app/drawer/ExitProfileDialogFragment.kt | 1 - .../java/org/oppia/android/app/profile/AddProfileActivity.kt | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 66d46e74f0c..2ae2a26048e 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -5,8 +5,6 @@