@Query("SELECT * FROM userdata")
Flowable<List<UserData>> allUserDatas();
@Insert(onConflict = OnConflictStrategy.REPLACE)
List<Long> insert(List<UserData> datas);
userDao.allUserDatas()
take(1).
filter(....)
.subscribeOn(io())
.observeOn(mainThread())
.subscribe(userDatas -> Log.i("TAG",""+userDatas));
I added fetching with subscription in the same fragment in onAttach() but after DB update it doesn't call the subscription of fetching from DB, why
I found the problem.
It was because of take(1)
, as it makes complete and that is why I could not listen to changes. Removing take(1)
fixed that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With