After a simple flutter create my android launch mode is set to "singleTop".
<!-- android/app/src/main/AndroidManifest.xml -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application ...>
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
...
This is awful user experience. It prevents screen split, multiple instances and maybe other desirable features.
Why is that needed? I changed it back to "standard" and saw no problems from it.
my question is: what? What will break setting it to "standard"?
In an Android native app, an app can deep link into another app by initializing an activity.
However, when launchMode:singleTop is used in the manifest, a new activity is created when the current activity isn't at the top of the target task. This means that a new Dart entrypoint is created every time a new activity is created.
Because an activity has a 1:1 relation with a Flutter engine, there's no state synchronization between these two activities that would allow an app to skip certain screen. e.g. a login screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With