I\'m trying to write an Android activity instrumentation test that stops (onPause(), then onStop()) and restarts the current activity. I tried
onPause()
onStop()
Change your code as follows:
mActivity.finish(); setActivity(null); mActivity = this.getActivity();
A full explanation can be found in this question