`
REALGODO
  • 浏览: 176627 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

BlackBerry 异常UI engine accessed without holding the event

 
阅读更多

 



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;
			}

		}
	}
 

 

分享到:
评论

相关推荐

    Jet4Win7x86

    用于解决Problem: Accessing the database. The Master Database cannot be accessed. Features using the Master Database will not be available.的问题,详细方法见我的博客!

    vue结合element-ui和quill富文本编辑器实现上传视频和封面

    Vue.js,作为一款流行的前端框架,与组件库Element-UI的结合为开发者提供了便捷的UI解决方案。而Quill,作为强大的富文本编辑器,支持自定义功能,如上传视频和封面。本篇文章将详细介绍如何在Vue项目中利用Element-...

    ADOL-C a package for the automatic differentiation of algorithms written in C C++

    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...

    Recover4all Professional

    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 ...

    Hagel DU Meter 6.20.4628.0 破解补丁(不需断网)

    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 ...

    JavaScript APIs HTML5

    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` ...

    微软内部资料-SQL性能优化5

    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 Art of SQL

    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 ...

    Tools and Techniques for Audio Debugging

    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" 错误 在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 – The Memory System - 2

    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 ...

    UTMI HOST MODLE

    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 ...

    polycom宝利通视频会议软件3.9 2018

    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 ...

    java面试题英文版及其答案

    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 ...

    微软内部资料-SQL性能优化2

    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...

    Jet4Win7x64

    用于解决Problem: Accessing the database. The Master Database cannot be accessed. Features using the Master Database will not be available.的问题,详细方法见我的博客!

Global site tag (gtag.js) - Google Analytics