This question has been asked too many times, but I did not find an answer to this yet.
I am struggling to clean my local data store on log out. what I am doing is I am pinning objects on various activities, and once user presses Logout, I call unpinALLInBackGround(); Apparently this does not cleans the localDataStore, once I log in from another user. I can still see the old entries.
what I want is a complete flush of entries in localDataStore.
In a particular activity:-
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
if(isNetworkAvailable()){
ParseObject.unpinAllInBackground(objects); // remove previous objects
ParseObject.pinAllInBackground(objects); // pin new objects
}
}
}
});
And On LogOut:-
ParseObject.unpinAllInBackground();