Can Static Variable Value Be Nulled By System In Android App?
I have noticed, that when android OS closes activities which are not in the top of activity stack, some of my static variables become null. I'm absolutely sure, the variables point
Solution 1:
Android does not close activities which are not on top of the activity stack. If your application goes to the background and Android decides that it wants to reclaim the memory it just kills the process that hosts your activities. When the user returns to the application, Android creates a new process and recreates the activity that was on the top of the activity stack.
In most probability, that's what you are seeing. Obviously if your process is killed and recreated, your static variables will be null.
Post a Comment for "Can Static Variable Value Be Nulled By System In Android App?"