getWallpaper() is not leaking. The default Home app is using it and
does not experience out of memory errors because of that.

I am more than willing to fix any existing memory leak in the
framework (and I did several times) or in the default apps (and I did
several times) but developers should really stop assuming that out of
memory errors are always caused by the framework. It is *very* easy
for an application to leak or simply to use too much memory.

On Thu, Mar 12, 2009 at 7:24 AM, JP <joachim.pfeif...@gmail.com> wrote:
>
>
> Sounds like the Drawable remains attached to a View between rotations.
> See blog post:
> http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html
>
>
> On Mar 12, 3:29 am, ursnavin <ursna...@gmail.com> wrote:
>> Hi ,
>>
>> Im  trying to develop a home application . Whenever there is a shift
>> between landscape and potrait mode , im setting the wallpaper onCreate
>> () function using the below code .
>>
>> getWindow().setBackgroundDrawable(getwallpaper());
>>
>> The code seems to work fine for first few shifts , but after that I
>> run into an out of memory exception . Is  this the correct approach or
>> am i missing some thing here . Below is the exception that i get .
>>
>> 03-12 15:08:55.118: ERROR/AndroidRuntime(739):
>> java.lang.OutOfMemoryError: bitmap size exceeds VM budget
>>
>> Thanks
>> Navin
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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

Reply via email to