3

Basically i do not want to show my app activity task in recents app..Have only one activity in my app.

Here is my Activity details:

<activity
    android:name=".MyActivity"
    android:allowTaskReparenting="true"
    android:alwaysRetainTaskState="true"
    android:configChanges="orientation|keyboardHidden|fontScale|locale|layoutDirection|screenSize|screenLayout|mnc|mcc|navigation"            
    android:excludeFromRecents="true"
    android:hardwareAccelerated="false"
    android:launchMode="singleTop"
    android:theme="@style/myTheme" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

http://developer.android.com/guide/components/recents.html#removing

Device : Nexus 5X
Android Version: 6.0.1

Scenario 1:

1)Click on the app.

2)Press home button.

3)Click on recents list / overview screen.

4)App not listed in recents list.

Scenario 2:

1)Click on the app.

2)Click on recents list / overview screen.

3)App listed in recents list.

/**
 * If set, the new activity is not kept in the list of recently launched
 * activities.
 */
public static final int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = 0x00800000;

whats the reason? Is these below attributes something to do with it ?

android:allowTaskReparenting="true"
android:alwaysRetainTaskState="true"

Thanks

Nithin

sKhan
  • 9,694
  • 16
  • 55
  • 53
NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74

0 Answers0