How to call a method every time activity is viewed?
As an example, I am moving from activity1 to activity2 . Now again go to activity1 . Every time activity1 displayed / moved to this action, I need to run the loadEveryTime() method. How can i do this? Please, help!
activity1
activity2
loadEveryTime()
onResume() is called every time the action resumes, so put a method call there. Do not forget to call the superclass.
onResume()
@Override protected void onResume() { super.onResume(); loadEveryTime(); }