You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to keep Activity Stack, when user press home button and re-open the app via app icon.
So, I changed the launchMode of MainActivity to standard from singleTask.
And then, activity stacks are kept as expected.
Installing APK or running via android studio, It works well without the problem.
But, multiple MainActivity are overlapped with react-native run-android.
It is not reproduced after kill the app from task manager.
Current script for launching the app is shell am start -n package/activity
But, Intent started from Home screen has options act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
I'm not sure about the principle behind it, but it seems that the two differences are causing the problem.
I launched app with shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n package/activity then problem is not reproduced.
How about adding flags -a android.intent.action.MAIN -c android.intent.category.LAUNCHER to current script?
I launched app with shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n package/activity then problem is not reproduced.
Thanks for reporting. This is a bug and should be fixed in the cli-platform-android package as we should align our adb launch parameters to the one used by Android Studio.
Environment
System:
OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 1.96 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.asdf/installs/nodejs/16.14.2/bin/node
Yarn: Not Found
npm: 8.5.0 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: 2023.03.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/junghwan/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.6 => 0.71.6
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Description
In my app, another activity is started by RN native modules like facebook/react-native#30726
I want to keep Activity Stack, when user press home button and re-open the app via app icon.
So, I changed the launchMode of MainActivity to standard from singleTask.
And then, activity stacks are kept as expected.
Installing APK or running via android studio, It works well without the problem.
But, multiple MainActivity are overlapped with react-native run-android.
It is not reproduced after kill the app from task manager.
For simple testing, I used initial template without implementing to start other activity.
https://user-images.githubusercontent.com/53458426/231677848-a44468e7-7518-4853-8034-57a750ffd6d3.mov
Reproducible Demo
npx react-native@latest init TestProject
standard
fromsingleTask
npm start
npx react-native run-android
Step 5
The text was updated successfully, but these errors were encountered: