ursnavin 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
Sounds like a memory leak. Are you sure getWallpaper() isn't doing something that would hold references to past bitmaps, causing them not to get garbage collected? -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training in Sweden -- http://www.sotrium.com/training.php --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---