Call MyMethod()
in onResume()
of Activity
As per documentation onResume()
is called when the activity will start interacting with the user. At this point your activity is at the top of the activity stack, with user input going to it.
protected void onResume() {
super.onResume();
MyMethod();
}