如何从最近通话排除导出的活动? [英] How to exclude from recents an exported activity?

查看:214
本文介绍了如何从最近通话排除导出的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个出口的活动,可以从其他应用程序中调用(特别是共享的行动 - android.intent.action.SEND )的应用程序

I have an app with an exported activity that can be invoked from other apps (Specifically the sharing action - android.intent.action.SEND)

如何导出的活动被排除在最近通话?

我不明白的方式来设置 FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS 标记,因为它是从外部调用。

I don't see a way to set the FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag, because it is invoked from the outside.

我想这样做的原因是因为在最近通话时,点击这个意向成为最后一个在我的活动栈,因此,一个文件被重新共享,而不是主要活动弹出。

The reason I want to do this is because this intent becomes the last one in my activity stack, thus when clicking on the recents, a file is being re-shared instead of the main activity to pop up.

注意安卓launchMode =singleTask解决问题在特定的情况下,只有在另一项活动是在上面。但,这不是一种选择,因为它破坏了用户任务流程,并且不工作,如果有在根没有其他应用程序的活动

Note: android:launchMode="singleTask" solves the problem in a specific case, only where another activity is on top. BUT, this isn't an option because it disrupts the user task flow and doesn't work if there is no other app's activity at the root.

推荐答案

您可以添加的安卓excludeFromRecents attirbute您<活性GT; 元素清单与true值:

You can add the android:excludeFromRecents attirbute to your <activity> element in the manifest with a value of true:

<activity
    android:name="XYZ"
    android:excludeFromRecents="true">

这篇关于如何从最近通话排除导出的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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