如何恢复,而不是将默认主页发射器previous活动 [英] How to resume previous activity instead of going to default HOME launcher

查看:214
本文介绍了如何恢复,而不是将默认主页发射器previous活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个设置活动时我preSS同时两个音量键将被解雇。我使用从PhoneWindowManager.java一个Intent如下调用此设置活动,

I have created a settings activity which will get fired when I press the two volume keys simultaneously. I am invoking this settings activity using an Intent from PhoneWindowManager.java as below,

Intent intent = new Intent("com.MyApp.Settings.EXT_SETUP");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intnt);

我也运行自定义启动应用程序。虽然自启动运行时,我可以用$ P $调用我的设置活动pssing的音量按钮。

I am also running a custom launcher application. While the custom launcher is running, I am able to invoke my settings Activity by pressing the volume buttons.

但问题是,在退出自定义设置活动之后(通过调用完成()),控制是不会的自定义启动(这是previous活动任务)。相反,Android的呼唤这是导致要HOME屏幕,而不是恢复我的自定义发射器发射家活动。

But the problem is, after exiting the custom settings activity ( by calling finish()), the control is not going to the custom launcher (which is the previous active task). Instead Android is calling home launcher activity which is resulting in going to HOME screen instead of resuming my custom launcher.

我已经试过了意向标志 FLAG_ACTIVITY_CLEAR_TOP FLAG_ACTIVITY_ preVIOUS_IS_TOP 。但是毫无效果。

I have tried the Intent flags FLAG_ACTIVITY_CLEAR_TOP, FLAG_ACTIVITY_PREVIOUS_IS_TOP. But nothing worked.

请让我知道我如何能离开我的设置活动后调用自定义启动。

Please let me know on how I can invoke the custom launcher after exiting my settings Activity.

在此先感谢,
Phani

Thanks in advance, Phani

推荐答案

清洁香港这一点

Intent intent = new Intent("com.MyApp.Settings.EXT_SETUP");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
mContext.startActivity(intnt);

Intent.FLAG_ACTIVITY_SINGLE_TOP); 如果设置,该活动将不如果是已经在历史堆栈的顶部运行启动

Intent.FLAG_ACTIVITY_SINGLE_TOP); If set, the activity will not be launched if it is already running at the top of the history stack.

这篇关于如何恢复,而不是将默认主页发射器previous活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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