从一个小部件启动时在最近用过的活动列表不显示 [英] Activity not showing in list of recent apps when launched from a widget

查看:88
本文介绍了从一个小部件启动时在最近用过的活动列表不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个应用程序插件,点击后,在我的应用程序将启动一个活动。

I have created an app widget which, when clicked, launches an Activity in my application.

它启动的活动是不会的主发射活动​​(如应用程序清单中设置)。

The activity it launches is NOT the main launcher activity (as set in the application manifest).

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

我启动了launchMode =singleTop活动(可能与此有关)

The activity I'm launching has launchMode="singleTop" (may be relevant)

如果我从应用程序启动器,然后preSS回家,然后最近应用程序按钮启动应用程序,该应用程序是存在的。
然后我删除从最近的活动列表或强制的应用程序将其关闭。

If I launch the app from the app launcher, then press home and then the recent apps button, the app is there. I then remove the app from recent activities list or force close it.

如果我再点击我的小部件,该活动推出的罚款。
我当时的内政preSS,然后应用程序不会出现在最近的应用程序列表。

If I then click on my widget, the activity launches fine. I then press Home and then the app does not appear in the list of recent apps.

任何想法?

推荐答案

我的活动与标志 Android的定义:在清单excludeFromRecents =真正的
我傻,应该已经发现了更早。
删除该标志解决了这个问题。

My activity was defined with flag android:excludeFromRecents="true" in the Manifest. Silly me, should've spotted that earlier. Removing that flag fixes the problem.

这篇关于从一个小部件启动时在最近用过的活动列表不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆