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. Scrolling large image - working good but slow

Hi all,

For a project, I'm displaying an image with sizes 800 x 600 and I've
implemented my custom scrolling (horizontal and vertical) - which is
works fine. However, my problem is that it's not fast enough. If you
continuously move your finger on screen for instance, scrolling is not
responding fast enough. There is a lag and you need to wait (say
400-500ms) for new scrolled image to be loaded.

Now below I described how I implemented scrolling and my question is

- How can I make it faster, if possible
- Is there any other better way to implement this.

Thanks in advance!!


My custom scrolling solution:

* I have a Main activity, SurfaceView and a thread
* In main activity, I'm using GestureDetector and override onScroll
* In onScroll method of activity, I'm passing values to SurfaceView's
"handleScrolling" method.
* In "handleScrolling" method, I'm calculating proper values and using
"newImage = Bitmap.createBitmap(myImage, starX, stopY, SCREEN_WIDTH,
SCREEN_HEIGHT)"; to create a new, "scrolled" image.

* Then in thread loop, I'm drawing this "newImage" to canvas.

Hope this much info helps.


2. How to switch off Anti-aliasing


Is it possible to switch off Anti-aliasing for a view or the




3. Saving Intents to use later (WAY LATER!)

4. ListView Scroll behaviour

5. How to test if app is shown on Market for all screensizes

6. How can I know date changed? seems android.intent.action.DATE_CHANGED works not properly

7. Custom Drawable (Gradient) based on Theme