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


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 
Offer expires soon (You save $237.5 )

BidEgg Amazing Low price Auction Site


Other Threads

1. Salam Kenal - Sekalian WTA : LG P500 restart randomly

Siang semuanya,

Salam kenal ya.. saya newbie di android nih .. barusan 'mengakuisisi'
OptimusOne nih, hasil hasutan suami tercinta ... hehe ..
Jadi newbie ini mau tanya sama para ahli android disini, kenapa ya O1 saya
suka restart sendiri?
baca2 di forum katanya ada yg suruh ganti SD Card-nya, ada juga yg suruh
upgrade ke latest firmware..

anyone ngalamin hal yg sama?
any suggestions?

Thanks in advance..



2. Proxy development (in source)

I am trying to build a proxy for Android in the source and I need to set the
proxy option under 'Settings'.

After researching in the internet, I found out that there is a 'settings.db'
file in /data/data/ path,
into which values are inserted into the table named 'system'. This works for
the emulator (either by starting the emulator at runtime with parameters or
by adb shell).

Question is, will the same approach as mentioned above, incorporated into a
class file and built into source, be suitable for setting the proxy?

If at all, this method is feasible, will the browsers and the other apps
which use internet, be able to detect the proxy?

Thanks in advance, for any help and suggestions.

P.S. I will be flashing the code to a dev phone.



3. How to add horizontal scrollbar at runtime?

4. resume issue

5. How do i upload the file from android mobile to public server

6. porting drivers of kernel-msm_2.6.29 into linux failed

7. how to use cache memory to store data temporary?