I have a ListenerForSingleValueEvent
that checks for a particular value in the database before a particular operation can be carried out. But because .setPersistenceEnabled
is true, it uses the value from the disk cache which could be sometimes wrong and not updated and causes the user to perform the task even though the user should not be able to.
I could set .setPersistenceEnabled
to false, but I have a chat feature and it would be very user unfriendly to reload messages each time the user opens the app. Is there a way I could set .setPersistenceEnabled
for only some particular Database References and reload all other references each time or vice-versa, i.e, .setPersistenceEnabled
for all Database References and reload particular references each time. Thanks for the help.