出现在Android设备BACK按钮的点击闪屏 - 使用PhoneGap的创建 [英] splash screen appears on click of android device BACK button -- Created using PhoneGap

查看:195
本文介绍了出现在Android设备BACK按钮的点击闪屏 - 使用PhoneGap的创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经创造了机器人与PhoneGap的版本1.3 PhoneGap的应用程序。

We have created a phonegap application for android with phonegap version-1.3.


  1. 在我的应用程序的任何页面上,并开始使用该设备BACK按钮,出现Android的启动画面/ POPS有时候,然后previously访问的页面显示。

  1. When I am on any page of the application, and start using the device BACK button, the Android SPLASH screen appears/pops sometimes, and then the previously accessed page is shown.

功能onBackKey $ P $(PSS)

function onBackKeyPress()

有时,当我点击一些链接,它打开浏览器,之后我点击后退按钮,它显示启动画面和重新启动应用程序。

Sometimes when i click on some links which open the browser, and after i click on back button, its Showing Splash screen and relaunch the application.

有没有我们可以使用后退按钮?

Is there any other function we can use for back button?

推荐答案

从从中你想退出应用程序覆盖onBack preSS启动画面前的活动。

From the activity before splash screen from which you wish to exit application override onBackpress.

@Override
public void onBackPressed() {
    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_HOME);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);

}

这篇关于出现在Android设备BACK按钮的点击闪屏 - 使用PhoneGap的创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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