I am writing an application using the new cloud firestore database. It works great, except for the fact that during battery life, many functions do not work smoothly, although the battery mode is turned on. For example, I do the following:
ref.delete().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
} else {
}
}
});
However, the method is onCompletenever called offline. I want to close the activity and show Snachbar as soon as this happens. But more than ever, activity remains open. I am using an android studio emulator.
thanks
source
share