It depends upon how you are going our of the application in android device. If you are pressing direct home button from the device then the state of an application will be remain as it was and if you are going out by clicking back button from android device, then there is one work around for the same.
For back button, you can ask for the confirmation to user, whether he/she wants to exist the application or what?