So Basically what I want to do is simply change some values in the database when an App is minimized or Stopped!
This is how my code looks like:
@Override
protected void onStop() {
super.onStop();
FirebaseUser currentUser = mAuth.getCurrentUser();
if(currentUser != null) {
mUserRef.child("online").setValue(ServerValue.TIMESTAMP);
}
}
But the problem is when I call startActivity(startInten) i.e move to second intent this method is called at that time as well. I have researched a lot on the internet. Can anyone tell me which activity lifecycle method is the one which is only called when the app is minimized and killed and not when we intent to other activity within the same app?
Thanks.