如何在Android中将会议室数据库用作会话?

时间:2019-07-28 10:53:34

标签: android android-room

我当时使用的是Realm,但现在想移至Room数据库。

由于Room Database查询在后台线程上运行,因此我对此有疑问。在领域上,我已将user numberuser nameuser password保存在领域上,并按顺序进行一些操作。

正如文档所述:

Disables the main thread query check for Room.

Room ensures that Database is never accessed on the main thread because it may lock the main thread and trigger an ANR. If you need to access the database from the main thread, you should always use async alternatives or manually move the call to a background thread.

You may want to turn this check off for testing.

但是在房间里,由于背景原因,我必须等待用户密码才能进行操作。有什么事可以不用等待吗?

I am not sharing my code here because I am thinking how to do it before starting it.

0 个答案:

没有答案