I have parent Activity, where I have some code written in onResume() of the parent Activity. Now, suppose I went from my parent Activity to one of its child Activity, then at that instance, my parent Activity is on pause. Now when I again return from my child activity to my parent Activity I don’t want my parent activity onResume() to execute. I only want it to execute when the app turns off and when the app is on pause by clicking the home button.
So is it possible to do that? If so can anyone please suggest me?
You can make a
static boolean variable isChildSelected = falseand use it.on calling child intent set it to
trueand when returning back inonResume()check ifisChildSelectedistrueorfalse;if its true just assign
falseto it and if itsfalsethen run your SPECIAL code