简体   繁体   English

NoReadAccessException - 读访问从事件调度线程允许或内部只读行动

[英]NoReadAccessException - Read access is allowed from event dispatch thread or inside read-action only

System/api Configuration 系统/ API配置

Android studio version : 2.2.3
Gradle version : 2.2.1
Java version : 1.8
classpath 'com.android.tools.build:gradle:1.3.1'

Exception 例外

18:26:43 NoReadAccessException
         Read access is allowed from event dispatch thread or inside read-action only (see com.intellij.openapi.application.Application.runReadAction())
         Details: Current thread: Thread[ApplicationImpl pooled thread 20,4,main] 700161407
         ; dispatch thread: false; isDispatchThread(): false
         SystemEventQueueThread: Thread[AWT-EventQueue-0 2.2#AI-145.3537739 Studio, eap:false, os:Windows 10 10.0, java-version:JetBrains s.r.o 1.8.0_76-release-b03,6,main] 1350276257

When i tried to run application, i got this issue, can anyone know what i do to resolve this issue. 当我试图运行应用程序时,我得到这个问题上,任何人都可以知道我做了什么来解决这个问题。

You can use: 您可以使用:

 SwingUtilities.invokeLater(() -> {
      // your code here
 });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法完成Gradle执行导致仅允许从事件分派线程进行写访问 - Failed to complete Gradle execution cause write access is allowed from event dispatch thread only Gradle错误:仅允许在Android Studio中从事件派发线程进行写访问 - Gradle error: Write access is allowed from event dispatch thread only in Android Studio 从前台调度读取标签 NFC ID - Read tag NFC ID from foreground dispatch Android studio AssertionError:不要在dumb模式下从read内部调用waitForSmartMode - Android studio AssertionError: Don't invoke waitForSmartMode from inside read action in dumb mode 我如何才能像事件一样使用 Firebase 访问 DataSnapshot,只有没有事件? 所以我只想从孩子那里读出数据 - How can I access DataSnapshot with Firebase like an event, only without an event? So I just want to read out data form a child 来自错误线程的领域访问。 尝试在Spinnerlistener内部使用时,只能在创建的线程上访问领域对象 - Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created, while trying to use inside spinnerlistener 使用RxJava中的可观察线程对数据进行“只读”操作 - Do something with the data “read only” using observable thread in RxJava 实现SQLite Manager以进行线程安全的读/写访问? - to to implement a SQLite Manager for thread-safe read/write access? 阅读短信并执行操作 - Read SMS and perform action 如何从另一个线程中访问和修改操作栏内容 - How to access and modify the Action Bar content from within another thread
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM