db.activitiesDao().insertStep(step);
Run Code Online (Sandbox Code Playgroud)
这将返回臭名昭着的错误:
java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
Run Code Online (Sandbox Code Playgroud)
我是RxJava的新手,不想使用AsyncTask.