A.A.I.A A.A.I.A -3 years ago 121
Android Question

Why defining Flowable I could receive updates of the DB

@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

Answer Source

I found the problem , It was because of take(1) as it makes complete that is why I could not listen to changes.remove take(1)will work

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download