I am logging out a user and shows the login screen...
# android
a
I am logging out a user and shows the login screen. While logging out I want to clear all the data from room db. Logout is working fine but database is not getting cleared. I think the issue is occuring because the db clear function is getting called from viewmodel and viewmodel lifecycle get destroyed after moving to login screen. So how can I handle this issue ? Or what is best way to handle logout flow ?
r
Maybe - Don't log out the user(use some progress indicator while removing your old data ) until the data the cleared.