Android Question Saving variable.

red30

Well-Known Member
Licensed User
Longtime User
I have a variable: Process_Globals Public MainVal As String.
I use it in several activities. When I launch my application, and then hide and restart - everything works fine. But if I hide the application and run many other applications, and then launch my application again, the value of this variable is rubbed. Why does it happen? How can i save and not lose the variable?
 

josejad

Expert
Licensed User
Longtime User
You should use starter for that kind of variables. If you need It to persist, save It in a file or use kvs.
You should read about android cycle of life
 
Upvote 0
Top