We are developing a home screen replacement app (a kind of launcher), so our home activity is defined as follows:
<activity android:name="Home"
...
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
(see Use my own Android app/apk as launcher/Home Screen Replacement)
This works great, except for the following scenario:
At this point, activity A is shown again.
However, I expect the application to show the home activity. After all, the user went from the home activity to activity B.
What are we doing wrong?
Switching to android:launchMode="singleTask"
solved the problem.