Static reference gets gc

by Alexey » Sat, 07 Mar 2009 03:59:43 GMT


Sponsored Links
 Hi All , i have  a config class where i store properties . It has a
static reference to itself and I initialize it when i start the
application. But if i'm if i switch back to my app after like an hour
of initial run - it looks like this object gets GC and not exist
anymore. As a workaround i start to check for it at onStart in my
activities but still don't understand why it's gone if it has a static
reference.


--~--~---------~--~----~------------~-------~--~----~



Static reference gets gc

by Marco Nelissen » Sat, 07 Mar 2009 04:22:17 GMT


 It's not so much that your object got GC'd, but that your process was
removed because nothing was running in it, and space was needed for
other processes.
If you want something to run in the background, use a service.
If you just need to store some properties between invocations of your
app, write them to a SharedPreference or something, don't keep an
entire process around to hold them.





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Static reference gets gc

by Alexey » Sat, 07 Mar 2009 04:28:38 GMT


 umm.. i don't think so - process was still there in the tasks list




--~--~---------~--~----~------------~-------~--~----~



Static reference gets gc

by tine brin » Sat, 07 Mar 2009 10:54:23 GMT


 Coupon for bidegg $237.5 off First purchase

 http://BidEgg.com 
COUPON: EFA3A
Offer expires soon (You save $237.5 )

BidEgg Amazing Low price Auction Site

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Socket Development

Hi everybody,

I am working on an application which communicates with different
machines (Linux) via sockets.
My problem is the following:
I want to be able to connect from my phone (which is connected via
USB) to the development machine. With the emulator, I just use the IP
of the machine and it works. But when I am using an actual devices I
can't connect to the machine, since the mobile is not in the same
network.
How do you solve this problem?

Thanks in advance!
Cheers,
David

-- 

2. Remember: Native WebApps clear App cache not browser cache

Answer to my weird pagination issue.. it was an old cached version of my 
page loading that was the culprit all along!

-john

-- 

3. ETA for OpenGL ES 2.0 in the simulator

4. Reminder App! feature request?

5. How To Use MTP-connected Devices

6. Where can i find android.provider.calendar package....?.

7. Android Map API: Route between 2 location and direction