From 7a42596438018129d52ff04899ab4ddabd27cdcb Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Mon, 2 Dec 2019 11:37:42 -0800 Subject: [PATCH] MainActivity launchMode is singleTask (#27373) Summary: Most RN apps have single activity, and developers expect to resume application from background when app icon pressed. But Android default configuration creates a new activity instance, which confuses developers, see https://github.com/facebook/react-native/issues/27370 and https://github.com/facebook/react-native/issues/27368. This PR changes template manifest so that when app icon pressed, background app will resume instead of creating a new activity, therefore match developers expectations. Also it's required to make Linking work. ## Changelog [Android] [Changed] - MainActivity launchMode is singleTask Pull Request resolved: https://github.com/facebook/react-native/pull/27373 Test Plan: RNTester will resume background app, instead of creating a new instance when app icon pressed Differential Revision: D18766373 Pulled By: mdvacca fbshipit-source-id: 697e9c5bf92ec958de265b060dffb50f7b74d157 --- RNTester/android/app/src/main/AndroidManifest.xml | 1 + template/android/app/src/main/AndroidManifest.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/RNTester/android/app/src/main/AndroidManifest.xml b/RNTester/android/app/src/main/AndroidManifest.xml index d520a547e7a..d47ee519ae3 100644 --- a/RNTester/android/app/src/main/AndroidManifest.xml +++ b/RNTester/android/app/src/main/AndroidManifest.xml @@ -35,6 +35,7 @@ android:name=".RNTesterActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" + android:launchMode="singleTask" android:configChanges="orientation|screenSize|uiMode" > diff --git a/template/android/app/src/main/AndroidManifest.xml b/template/android/app/src/main/AndroidManifest.xml index 362d33beb78..0a7a9cfc66c 100644 --- a/template/android/app/src/main/AndroidManifest.xml +++ b/template/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" + android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">