Room DateBase 에 접근할 때 Main Thread 에서 하게 되면 오류 발생한다.
[해결 전]
DataRespository class 에서 Room 에 접근하려고 할 때 '~.subscribeOn(schedulerProvider.io())' 코드를 빼먹었더니
오류 발생함.
[해결 후]
'~.subscribeOn(schedulerProvider.io())' 코드 추가.
참고)
Android Room database RxAndroid, Exception : java.lang.IllegalStateException: Cannot access database on the main thread since
Currently, I am fetching data from Web API using RxAndroid and Retrofit, and want to store that Data in Room database but getting an exception As I search and found that, room database operations ...
stackoverflow.com