I am drawing a frame by frame animation to a canvas and I have about 100 pics that I'm using to do this (which is about 1.5MB total). I started out by just doing this:
s000 = BitmapFactory.decodeResource(getResources(), R.drawable.s0);
s001 = BitmapFactory.decodeResource(getResources(), R.drawable.s1); ...etc...
to every image and then drawing each image to the canvas:
c.drawBitmap(s000, X, Y, null);
to make an animation.
The problem is that I get this error "OutOfMemoryError: bitmap size exceeds VM budget". How would I load all the pics without getting this error? Is 1.5MB to much memory or do I have a memory leak? What would I do to fix the memory leak?
Thank you very much for your help. I am noob with android so could you please leave examples and not just tell me to do something that I wont understand :) Thanks again