From 4ab6edeb308f41f889733b150a4405b458e6d028 Mon Sep 17 00:00:00 2001 From: Vincent Bourgmayer Date: Wed, 17 May 2023 13:19:27 +0000 Subject: fix screen orientation overriden by MainActivity.handleIntent(...) --- .../main/java/foundation/e/advancedprivacy/main/MainActivity.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/src/main/java') 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 ec33e25..277031a 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,9 +32,9 @@ 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) - handleIntent(intent) + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + if (savedInstanceState == null) handleIntent(intent) } override fun onNewIntent(intent: Intent) { -- cgit v1.2.1