Skip to content Skip to sidebar Skip to footer

Launchmode & Recent App Principle

I have a WidgetResultActivity and a NotificationResultActivity, I set both their launchmode=singleInstance. But they have different behaviors: WidgetResultActivity will not opened

Solution 1:

To prevent activity from being added to recents, add

android:excludeFromRecents="true"

to its <activity> declaration in Manifest:

<activityandroid:name=".NotificationResultActivity"android:launchMode="singleInstance"android:excludeFromRecents="true"android:theme="@android:style/Theme.Translucent.NoTitleBar" />

See: android:excludeFromRecents in android docs.

Solution 2:

android:taskAffinity=""android:excludeFromRecents="true"android:launchMode="singleInstance"

taskAffinity is needed, this works for me.

Post a Comment for "Launchmode & Recent App Principle"