a 1024x1024 bitmap will be (IIRC) 4MB. Creating a few will likely cause you to run out of memory. Use Bitmap.recycle to free up the resources that a bitmap you no longer need is using
On Jun 23, 9:07 am, hamlatzis <[email protected]> wrote: > My application crashes after I try to use the static Bitmap > createBitmap method to get a mutable bitmap in order to fill it later > with data. > > If I only create one 1024x1024 the application works just fine, but > when I try to load the same image more than once (first making my > object null in each round) my application crashes on my third or > fourth try. > > eg > Bitmap mpBitmap = null; > > void CreateBitmap(int nWidth, int nHeight) > { > if ( mpBitmap != null ) > mpBitmap = null; > mpBitmap = Bitmap.createBitmap(nWidth, nHeight, > Bitmap.Config.ARGB_8888); > > } > > I get the same result if I create a smaller image but then I need more > runs before the crash. In all cases my application works just fine if > I only create the image (even 1024x1024) once, then exit my > application and run it again. > > If there is a need for "crash dump" I can provide one. > > Any help will be appreciated. > > Thanks, > > Iosif --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

