State of variables inside an Android activity

view story

http://stackoverflow.com – I have defined a global variable inside an activity, this variable changes depending on the button user has pressed. If I go outside of my app UI and come back by holding the home button which shows the list of recent apps, then my variable keeps its state. But if I run my app again by pressing the app luncher icon the variable state is gone. Is there a way to keep the state of the variable? (HowTos)