The behavior of the activity stack back is no longer strange when defining the main activity using singleTask at the same time:
<activity android:name=".MainActivity" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
To make matters worse, there is no clear explanation in the official developer guide regarding this particular use case. Some sections related to this topic even contradict each other.
Try using launchMode = "standard" on MainActivity A and launchMode="singleTask" on Activity B to give a description of the expected behavior.
yorkw source share