Now i\'m trying to make like a instagram chat program using firebase the problem is i want to show that member login status but android life cycle is problem
Here
Whenever user is in your app, technically he is online. So in your home activity use this:
@Override
protected void onStart() {
super.onStart();
myRef.child(uid).child("isOnline").setValue(true);
myRef.child(uid).child("isOnline").onDisconnect().setValue(false);
}
and also i would suggest to add to override onResume():
@Override
protected void onResume() {
super.onResume();
myRef.child(uid).child("isOnline").setValue(true); //User back online
}
Make sure to add an if statement to check if user is connected to internet or not!