Android 应用程序当前活动带来的前沿问题 [英] Android application current activity bring to front issue

查看:24
本文介绍了Android 应用程序当前活动带来的前沿问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本问题,我认为附加任何代码片段都无济于事.当我们在应用程序位于前面时按下主页按钮时,我们会转到主页,应用程序失去焦点.

I have a basic question for which I don't think attaching any code-snippet may help. When we press home button while an app is in front we go to the home page and the app loses its focus.

现在,我的应用程序必须在状态栏中有通知图标.和我的应用程序一样,有可能有 2-3 个活动可见(在对话视图中一个在另一个之上).在某些情况下,当我按下状态栏中的通知图标时,我不确定如何恢复这种状态.

Now, My application has to have notification icon in the status bar. And as in my application, there is a possibility of having 2-3 activity visible(one above another in dialogue view). In certain situation, I am not really sure as to how could I resume such state when I press notification icon in the status bar.

但是,当我按下主页按钮,然后按下主屏幕中的应用程序图标时,我得到了预期的一切.

But, when I press home button and then press the application icon in the home screen I get everything as expected.

那么,有什么办法可以让我对通知栏图标做同样的事情.

So, is there any way, by which I can do the same with notification bar icon.

推荐答案

有两种方法:

  1. 恢复任务的通知,而不是不是特定活动?

从通知中恢复应用程序和堆栈

这篇关于Android 应用程序当前活动带来的前沿问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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