如何将应用程序推送到它的前台推送背景? [英] how to push application to foreground of it is pushed background?

查看:97
本文介绍了如何将应用程序推送到它的前台推送背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在开发一个应用程序,在该应用程序中我创建了一个屏幕,即活动.显示活动后,它将禁用所有键.但是有一些我可以将应用程序切换到后台的方式.那么,如果我的应用程序被推送到后台,有什么方法会自动又回到前台吗?与在Blackberry中一样,我们可以使用activate()和deactivate()方法来做到这一点.

Hi guys I am developing an application in which I have created a screen i.e is activity. once the activity is been displayed it disables all the keys. But some how I am able to switch my application to background. So is there any way that if my application is pushed to background it automatically comes again to foreground? As in blackberry we can do it using activate() and deactivate() method.

推荐答案

@Override
    protected void onPause()
    {
        super.onPause();
        startActivity(getIntent().addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
    }

这篇关于如何将应用程序推送到它的前台推送背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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