I have a problem with my Live Wallpaper app.

It has a settings button where the user can change the background
image (and a couple of more things).
I store information as shared preferences (see the Live Wallpaper
tutorial).

After starting it the memory allocated by the app is constant and
doesn't seem unreasonably high.

But then if I open up the Live Wallpaper picker again, picks my
wallpaper and then either sets the wallpaper again, or hits home/back
to cancel, the memory usage has increased.

This can be repeated several times and the used memory keeps
increasing.

Same thing happens if I have a solid background color instead of an
image, but the memory increases with less.

I've made sure that I don't load the same image twice (if the user
selects the same image again I don't load anything). I also tried
recycling the old image before loading the new one.
I use BitmapFactory.decodeFile to read the file from the SD-card. But
since the same thing happens without an image I guess it might not be
that anyway.
I've also made sure to set objects to null when done with them, but
that doesn't make a difference.

Does anyone know what could be wrong? Have any tips what I can look
for?
I tried the DDMS tool to track allocations, but nothing stood out.

Any help to find the source of this problem is greatly appreciated!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to