来自“最近的应用程序"的快捷方式总是启动应用程序的最新活动.如何改变呢? [英] Shortcut from Recent Applications always launch latest activity of application. How to change that?

查看:70
本文介绍了来自“最近的应用程序"的快捷方式总是启动应用程序的最新活动.如何改变呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想始终启动一个特定的活动,而不是在关闭应用程序期间处于活动状态的活动.我不可能在结束之前切换到所需的活动,因为它可能已经死了.

I would like to launch always a specific activity, not this which was active during closing application. I don't have possibility switching to desirable activity before closing, because it could be dead.

我甚至希望从最近的应用程序中删除整个程序的快捷方式,而不是让用户因启动信用而不是启动启动屏幕而感到困惑.但这只是解决方法(以防万一,我该怎么做?)

I would prefer even delete shortcut to whole program from recent app than make user confused by launch credits instead of start splash screen. However this would be only workaround (but just in case, how can I do that?)

推荐答案

如果您要每次通过相同的活动启动应用程序,请添加

If you mean you want to start your application through the same activity every time, add

android:launchMode="singleTask" 

到清单文件中的主要活动.这将迫使您的应用程序将此活动放在活动堆栈的底部,清除可能正在运行的所有其他活动.

to your main activity in the manifest file. This will force your application to put this activity at the bottom of the activity stack clearing all other activities which may have been running.

这篇关于来自“最近的应用程序"的快捷方式总是启动应用程序的最新活动.如何改变呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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