BB开发中发现了一个异常UI engine accessed without holding the event ,代码的大体结构式 一个Screen 注册到网络模块(另外一个线程)上,到网络状态发生变化,监听通知 Screen 进行UI上的变化 。
后来去网上查了一下,发现原来是由于BlackBerry的UI架构中避免多线程竞争等情况的一个机制引起的异常。BlackBerry中限定在同一时间内,只能有一个线程对UI执行更新操作,并且这个线程默认就是UiApplication子类的主线程。而其它线程如果直接试图修改UI,就会引起这个异常。
解决方法就是加入synchronized (UiApplication.getEventLock()){}代码块。
public void onConnectSuccess() {
synchronized (UiApplication.getEventLock()){
boolean isLogin = RmsFacade.getChars(RmsSeed.ENCODEKEY)!=null;
if(isLogin){
Intent intent = getIntent();
intent.setToScreen(TabScreen.class);
intent.startScreen();
ScreenFactory.getSingleInstance().screenFinish(WelcomeScreen.class);
}else{
Intent intent = getIntent();
intent.setToScreen(RegistScreen.class);
intent.startScreen();
ScreenFactory.getSingleInstance().screenFinish(WelcomeScreen.class);
BlzContext.getSingleInstance().netStatListener = null;
}
}
}
分享到:
相关推荐
用于解决Problem: Accessing the database. The Master Database cannot be accessed. Features using the Master Database will not be available.的问题,详细方法见我的博客!
Vue.js,作为一款流行的前端框架,与组件库Element-UI的结合为开发者提供了便捷的UI解决方案。而Quill,作为强大的富文本编辑器,支持自定义功能,如上传视频和封面。本篇文章将详细介绍如何在Vue项目中利用Element-...
The C11 package ADOL-C described here facilitates the evaluation of first and higher derivatives of vector functions that are defined by computer programs written in C or C11. The resulting derivative...
However, in the event You determine that any particular Registered End User will no longer be permitted to use the Registered Software, You may register a different individual by sending email ...
It can be accessed by holding the SHIFT key while opening the pop-up menu. Improved performance and better error reporting. Numerous bug fixes and minor enhancements. If you already have version 6.x ...
The Web Workers API allows for running scripts in background threads, enabling complex tasks to be performed asynchronously without blocking the UI. To create a worker, you need to use the `Worker` ...
If even one column in the query is not part of the index, the data rows must be accessed. The leaf level of an index is the only level that contains every key value, or set of key values. For a ...
The most vital corporate data is today stored in databases and accessed through the imperfect, but widely known, SQL languagea combination that had begun to gain acceptance in the pinstriped circles ...
This document provides different tools and techniques useful for debugging ...techniques assume that McASP is accessed through the Linux ALSA framework. 其中有一小节对于XRUNS的调试方法,还是非常实用的
### DataStage 如何解决 "job is being accessed by another user" 错误 在DataStage的日常使用过程中,可能会遇到一个常见的问题:“job is being accessed by another user”。这种提示通常出现在尝试编辑一个...
23. The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal ...
Chapter 8 of the Computer Organization & Architecture course delves into the crucial concept of the Memory System, specifically focusing on the Memory Hierarchy and Cache Memories. Memory Hierarchy ...
The IP is accessed via an AXI4-Lite slave register interface for control, status and data. Data to be sent or received is stored in some internal FIFOs. The data is accessed through the AXI4-Lite ...
1.1You may use the SOFTWARE PRODUCT pursuant to the license grant above and subject to the following terms and the proprietary notices in the SOFTWARE PRODUCT or on the media upon which the SOFTWARE ...
They can be accessed without creating an object and are stored in a separate memory area called the class area. Non-static members, or instance members, are unique to each object and require an ...
As such, non-paged pool can be accessed at any time without incurring a page fault. Because device drivers operate at DPC/dispatch level (covered in lesson 2), and page faults are not allowed at this...
用于解决Problem: Accessing the database. The Master Database cannot be accessed. Features using the Master Database will not be available.的问题,详细方法见我的博客!