RoomDatabase.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:AndroidLife 作者:
/**
 * Asserts that we are not on the main thread.
 *
 * @hide
 */
@SuppressLint("RestrictedApi")
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void assertNotMainThread() {
    if (mAllowMainThreadQueries) {
        return;
    }
    if (AppToolkitTaskExecutor.getInstance().isMainThread()) {
        throw new IllegalStateException("Cannot access database on the main thread since"
            + " it may potentially lock the UI for a long periods of time.");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号