Android:最近的任务列表,android:excludeFromRecents =" true" android的行为:launchMode =" singleTop"

时间:2016-02-19 15:37:11

标签: java android android-activity launchmode

基本上我不想在最近的应用程序中显示我的应用程序活动任务。我的应用程序中只有一个活动。

这是我的活动详情:

<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

  

设备:Nexus 5X
  Android版本:6.0.1

情景1:

1)点击应用程序。

2)按主页按钮。

3)点击最近列表/概述屏幕。

4)应用程序未在最近列表中列出。

情景2:

1)点击应用程序。

2)点击最近列表/概述屏幕。

3)应用程序列表中列出的应用程序。

/**
 * 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;

原因是什么?这些属性是否与它有关?

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

由于

尼西

0 个答案:

没有答案