Room怎么在主线程中跑?

在创建时allowMainThreadQueries()
如:
instance = Room
.databaseBuilder(context, AppDatabase.class, dataBaseName)
.allowMainThreadQueries())
.build();

你可能感兴趣的:(Room怎么在主线程中跑?)