I want to quit my application if it stays in background for 5 minutes. Is it possible to do that programmatically?
Its possible, run a background service with a timer task which checks the state of the application for a specified time period. This would be generally done using a BaseActivity and overriding onStop() and onWindowFocusChanged() Methods. Find more info here and here