How to create methode back to APP while paused to resume app

I want to create app when launch an activity, but user pressed home or open another app (paused activity), it can force go back on last activity on some times to resume the activity.

the examples:
if some one open the app and do activity, and he force to open another app, it can back to app automatically in some second.

thanks for sharing

This is a functionality, the user and also Google would not like very much and therefore it is not possible…