I want to access the activity lifecycle method of a different activity from the present one... Can i do that? for example i have 2 activities A and B. I want to access the onStop method of activity A from activity B. can i do that? i'm trying to check the online of a user in my app which has multiple activities so i want to write code which is like = If onStop/onDestroy method of both the activities are called show that the user is offline... The code im using is
@Override
public void onStart(){
super.onStart();
mDatabaseReference.child("Online").setValue(true);
}
@Override
public void onStop(){
super.onStop();
mDatabaseReference.child("Online").setValue(false);
}
Can someone please help me out