Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用该方法设置 aBitmapField的图像。setImage()它工作正常,但是当我尝试在线程上执行此操作时,它会抛出 aIllegalStateException并且它不起作用。
BitmapField
setImage()
IllegalStateException
有什么解决方法吗?
您需要在事件调度线程中进行更新(或至少获得锁)。最简单的方法是使用以下代码模式:
UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { ... your code here ... } });