[android-developers] Will static variables in a non-activity class remain in memory?

2011-06-20 Thread Droid
I am storing an ArrayList in a static variable in an ordinary (non activity) java class. It works correctly when I load it from an activity, but will it be guaranteed to remain in memory even when my activity is not calling it often? Here is the class: package com.maps.spoken; import

Re: [android-developers] Will static variables in a non-activity class remain in memory?

2011-06-20 Thread Kostya Vasilyev
Yes. This data will stay in memory for as long as the process is alive. 2011/6/20 Droid rod...@gmail.com I am storing an ArrayList in a static variable in an ordinary (non activity) java class. It works correctly when I load it from an activity, but will it be guaranteed to remain in memory

Re: [android-developers] Will static variables in a non-activity class remain in memory?

2011-06-20 Thread Dianne Hackborn
I wouldn't say yes. Calling it often does not make sure it remains in memory. You are only guaranteed it will remain in memory for as long as your app is in the foreground, that is as long as its process is required as per: