I have following code:
private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
private Paint mBitmapPaint;
mBitmap = Bitmap.createBitmap(480, 800, Bitmap.Config.ARGB_8888);
mCanvas = new Canvas(mBitmap);
mPath = new Path();
mBitmapPaint = new Paint(Paint.DITHER_FLAG);
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
canvas.drawPath(mPath, mRealPaint);
}
When i run it, it runs fine for few pages. Then after few pictures are done it force closes giving following exception:
E/GraphicsJNI(493): VM won't let us allocate 921600 bytes
D/AndroidRuntime(493): Shutting down VM
W/dalvikvm(493): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(493): FATAL EXCEPTION: main
E/AndroidRuntime(493): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
I read many posts on this topic. Updated Large heap to true, but it is still not working. Can someone please help me tell what am i doing wrong here?
More errors:
W/webcore(541): Can't get the viewWidth after the first layout
D/webviewglue(541): nativeDestroy view: 0x40a7b8
I/Ads(541): onReceiveAd()
D/dalvikvm(541): GC_EXTERNAL_ALLOC freed 1943 objects / 219448 bytes in 227ms
D/dalvikvm(541): GC_EXTERNAL_ALLOC freed 707 objects / 100576 bytes in 159ms
E/ActivityThread(541): Failed to find provider info for com.google.plus.platform