【问题标题】:Android exclude from recents not workingAndroid 从最近不工作中排除
【发布时间】:2018-02-01 00:05:55
【问题描述】:

我有一项不想在“最近”项目中显示的活动。我在我的清单文件中使用了以下内容:

<activity
        android:name=".WidgetLayout"
        android:excludeFromRecents="true"
        android:launchMode="singleInstance"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppTheme.Dialog">

它在所有 android 版本上都运行良好,但是当我在 Lollipop (SDK 21) 上尝试它时,它总是显示在最近的项目中。那么它是许多人所说的操作系统错误还是我犯了一些错误。有没有办法解决问题,如果是,那我该如何解决呢?

【问题讨论】:

    标签: android android-activity android-5.0-lollipop


    【解决方案1】:

    这是自 L 预览版以来 Android 5.0 中的一个已知问题。

    试试 android:taskAffinity

          android:taskAffinity=".WidgetLayout"
          android:excludeFromRecents="true"
    

    【讨论】:

      【解决方案2】:

      你应该尝试添加android:autoRemoveFromRecents="true"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-08-25
        • 2011-06-20
        • 2019-04-15
        • 2015-11-17
        • 2014-05-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多