I donβt think there is any specific reason why it should restart. There is a specific trigger for changing the configuration (for example, rotating the device or extending the keyboard), because the application must deal with the change. But any other process should go according to the Activitvy lifeCycle
When your application goes to the background (loses focus) for any reason, you call onPause() , and when it returns, onResume() called. This is the same when you return home and then back to your application or when you switch such actions. No new intentions or anything like that, just returning to this activity.
You should put your code that should be run in onResume() .
source share