本文介绍了首页启动问题,重新启动后,碎片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发将用于在工业环境中,如手持接口,分布和preconfigured通过我的工作场所的应用程序。我正在做的主页启动运行,这样将有片剂不太诱惑失踪的应用程序。

I am developing an application that will be used in an industrial setting as a handheld interface, distributed and preconfigured by my workplace. I am working on making the application run as the Home Launcher so that there will be less temptation for the tablets to "go missing".

解决

SOLVED

另外一个问题,我觉得可能是相关的,就是后退按钮和我后来的取消,都应该弹出回栈的某些点或者将根本不工作或执行不正确的弹出位置的按钮。

Another issue, that I feel may be related, is that the back button and my later cancel buttons that are supposed to pop the back stack to certain points either will not function at all or perform an incorrect pop location.

更新:的实施低于我的解决方案后,我已经解决了大部分问题,但​​如果我开始使用应用程序前2秒(约)内,则我还是结了随机背叠在大跌眼镜的位置。

UPDATE: After implementing my solution below, I have solved most issues, except if I start to use the application within the first 2 seconds (about) then I still end up with the random back stack locations upon popping.

SOLVED

- 部分已回答的2)什么会导致背部/取消键( popBackStack(...))不重新启动后正常运行?

PARTIALLY ANSWERED 2) What could cause the back/cancel buttons (popBackStack(...)) to not function properly after a reboot?

更多code可应要求提供方便的解决方案。

推荐答案

编辑:为了使装载更兼容,我能扎入 BOOT_COMPLETED 接收器和设置存储在一个布尔共享preferences 这将决定哪些片段要加载有根据的价值,这是重新在关闭的BroadcastReceiver。

To make loading more compatible, I was able to tie it into the BOOT_COMPLETED receiver and set a Boolean that is stored in SharedPreferences that will determine which fragments to load based on the value, which is reset on the SHUTDOWN BroadcastReceiver.

这篇关于首页启动问题,重新启动后,碎片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:49