申请截止上后退按钮按Intent.ACTION_WIRELESS_SETTING查看无线设置后, [英] Application closing on back button after viewing wireless setting by Intent.ACTION_WIRELESS_SETTING

查看:128
本文介绍了申请截止上后退按钮按Intent.ACTION_WIRELESS_SETTING查看无线设置后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似于<一href="http://stackoverflow.com/questions/24052642/application-closing-on-back-button-after-viewing-pdf-by-intent-action-view">this的问题,我加的没有历史标志以我的登录活动。在另一边,我在登录活动的一个按钮,显示无线设置。当我preSS回无线设置的意图,应用程序关闭!

Similar to this question, I added no history flag to my login activity. in another side, i have a button in login activity to show wireless setting. When i press back on wireless setting intent, application closed!

我怎么能没有历史标志 prevent从关闭的应用程序?

How can i have no history flag and prevent application from closing?

推荐答案

当您启动您登录活动使用的是没有历史标志完成另一项活动。您可能已启动无线设置旁边其他活动时,将你的无线设置到另一个活动或调用完成在登录活动。如果你保持无线按钮,在登录你不能使用没有历史。你必须设置一个标志,指示是否设置无线设置正在启动和的onStop称为完成(),如果该标志是假的。

When you launch another activity your login activity is finished using the no history flag. You either have to move your wireless setting to another activity or calling finish in the login activity when launching other activity beside wireless setting. In case you keep the wireless button in your login you cannot use no history. You have to set a flag to indicate if setting wireless setting is being launched and in onStop called finish() if this flag is false.

在您登录活动

private boolean mShowSetting;

在的onStop()

if (!mShowSetting)
{
    finish();
}

在你开始活动,以显示设置方法

In the method where you start the activity to show setting

mShowSetting = true;

和在onResume你必须设置

and in your onResume you have to set

mShowSetting = false;

这篇关于申请截止上后退按钮按Intent.ACTION_WIRELESS_SETTING查看无线设置后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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