From 1a72d4c0dc443cfbda73c26a4db6e1330c8c047b Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 17 May 2023 10:12:08 +0000 Subject: [PATCH 1/2] fix screen orientation overriden by MainActivity.handleIntent(...) --- .../main/java/foundation/e/advancedprivacy/main/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt b/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt index ec33e254..36f580a4 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt @@ -33,7 +33,7 @@ import foundation.e.advancedprivacy.features.trackers.TrackersFragment open class MainActivity : FragmentActivity(R.layout.activity_main) { override fun onPostCreate(savedInstanceState: Bundle?) { super.onPostCreate(savedInstanceState) - handleIntent(intent) + if (savedInstanceState == null) handleIntent(intent) } override fun onNewIntent(intent: Intent) { -- GitLab From 07dc1dca6cc3b8ec57257ef413dd43f7f04bf7d2 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 17 May 2023 14:23:54 +0200 Subject: [PATCH 2/2] replace onPostCreate() by onCreate() in mainActivity --- .../java/foundation/e/advancedprivacy/main/MainActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt b/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt index 36f580a4..277031a0 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/main/MainActivity.kt @@ -21,6 +21,7 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.os.Bundle +import android.util.Log import androidx.fragment.app.FragmentActivity import androidx.fragment.app.add import androidx.fragment.app.commit @@ -31,8 +32,8 @@ import foundation.e.advancedprivacy.features.location.FakeLocationFragment import foundation.e.advancedprivacy.features.trackers.TrackersFragment open class MainActivity : FragmentActivity(R.layout.activity_main) { - override fun onPostCreate(savedInstanceState: Bundle?) { - super.onPostCreate(savedInstanceState) + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) if (savedInstanceState == null) handleIntent(intent) } -- GitLab