在一些页[jQuery Mobile的/ Android的]禁用设备后退按钮 [英] Disable device back button on SOME page [jquery mobile / android]

查看:314
本文介绍了在一些页[jQuery Mobile的/ Android的]禁用设备后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要怎么处理这一些方法建议。我曾多页的应用程序,登录页面,注册页面,之后登录页面和...

I need some approach advice on how to handle this. I had multi-pages app, Login page, Register page, After Logged In Page and on...

现在我发现,用户登录后,我查看登录进入和编程方式将用户重定向到登录后,在主页。

Now I found out, after user logged in, I check the login into and programmatically redirect the user to the After Logged In Main Page.

问题从这里开始,在Android上,用户可以使用该设备后退按钮返回到登录页面,这是不符合逻辑的。

The problem start here, on Android, the user can use the device back button to return to the Login Page which is not logical.

问题,我怎么能prevent设备后退按钮仅在登录后,页面,以避免用户返回到登录页面。其他背我想允许用户用户设备后退按钮导航。

The question, how I can prevent Device Back button ONLY on the "After Logged in Page" to avoid user go back to Login Page. Other back I would like to allow user to user device back button to navigate.

在换句话说,我需要将一些页面,并非所有页面上禁用设备后退按钮。请指教,谢谢。

In other words, I need to disable Device Back button on some page, not all page. Please advice, thank you.

Lesz

推荐答案

您可以把这个在你的活动完全禁用后退按钮。

You can put this in your Activity to disable the back button completely.

@Override
public void onBackPressed() {
    return;
}

这篇关于在一些页[jQuery Mobile的/ Android的]禁用设备后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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