Android:禁用最近的应用程序意图
我想禁用当您按住主页按钮时从图标触发的最近的应用程序意图。我当前正在 onCreate()
中检测是否从快速启动对话框触发意图,然后调用 finish()
。
这意味着当应用程序进入后台时,finish()
会被调用,以便当应用程序启动时,它会执行 onCreate()
。这需要在应用程序中的活动之间切换时进行策略性编码。
我想我也可以在检测到意图来自何处后在 onResume()
中触发 finish()
,但是如果快速启动意图,则可以消除一堆不必要的编码可以简单地禁用。
可以禁用快速启动意图吗?
I want to disable the recent apps intent that is fired from the icon when you hold the home button. I am currently detecting, in the onCreate()
, if the intent is fired from the quick launch dialog, and then I call finish()
.
This entails that when the application goes to the background finish()
is called so that when the app is launched it goes through the onCreate()
. This requires strategic coding when switching between activities in the application.
I guess I can fire finish()
in the onResume()
also after detecting where the intent came from, but a bunch of unnecessary coding can be eliminated if the quick launch intent can simply be disabled.
Can the quick launch intent be disabled?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
android:excludeFromRecents="true"
在此活动的清单中。这将导致您的活动不会出现在最近使用的活动列表中,这就是我假设您所说的“快速启动”。Put
android:excludeFromRecents="true"
in the manifest for this activity. That will cause your activity not to appear in the list of recently used activities, which is what I am assuming you are calling the "quick launch".