How can i keep my application running on background longer.

After minimizing my application (taking the application to the background) after waiting for a certain time (5 minutes), the application does not continue from where it left off, it launches up from scratch again. I don’t want the app to be closes in the background. I know it’s not possible to prevent it from shutting down completely, I just want the app to stay in the background for more than 5 minutes. At least 20-30 minutes will be okay.