Skip to content

Commit 7a42596

Browse files
dulmandakhfacebook-github-bot
authored andcommitted
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 #27370 and #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: #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
1 parent 7e6fae2 commit 7a42596

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

RNTester/android/app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
android:name=".RNTesterActivity"
3636
android:label="@string/app_name"
3737
android:screenOrientation="fullSensor"
38+
android:launchMode="singleTask"
3839
android:configChanges="orientation|screenSize|uiMode" >
3940
<intent-filter>
4041
<action android:name="android.intent.action.MAIN" />

template/android/app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
android:name=".MainActivity"
1515
android:label="@string/app_name"
1616
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
17+
android:launchMode="singleTask"
1718
android:windowSoftInputMode="adjustResize">
1819
<intent-filter>
1920
<action android:name="android.intent.action.MAIN" />

0 commit comments

Comments
 (0)