[android-developers] Re: activity looses ArrayList<> items

2012-07-03 Thread RichardC
I don't think Vector is thread safe in the way you expect did you read: *"This class is equivalent to ArrayList with synchronized operations. This has a performance cost, and the synchronization is not necessarily meaningful to yo

[android-developers] Re: activity looses ArrayList<> items

2012-07-05 Thread alex b
I saw the notice about the syncronization of the Vector type, but it didn't help me find a solution to the problem. What I believe i need to do is... lock the ArrayList, Vector whatever update the ArrayList unlock the ArrayList but I don't know how to accomplish this. On Tuesday, July 3,

[android-developers] Re: activity looses ArrayList<> items

2012-07-05 Thread alex b
I've isolated the problem and this has nothing to do with ArrayList or Vector and everything to do with Garbage Collector. Both of those are working fine exactly as I coded them when I run the code in an isolated activity. Apparently GC is destorying my activity and recreating it and my onSav

[android-developers] Re: activity looses ArrayList<> items

2012-07-08 Thread Doug
What you really need to do is stop the thing that's updating your list before serializing it, then restart it from the point where it left off after deserializing it. Or find another way of coordinating this background work you're doing. Also, you shouldn't be calling restoreRecents in both on

Re: [android-developers] Re: activity looses ArrayList<> items

2012-07-05 Thread Kostya Vasilyev
All activity lifecycle callbacks are invoked on the same, main, UI thread. 2012/7/6 alex b > I saw the notice about the syncronization of the Vector type, but it > didn't help me find a solution to the problem. What I believe i need to do > is... > > lock the ArrayList, Vector whatever > update