Check if you can move this to onResume(), than a restart is not required. Check if you have to remove the flag in onPause()