Underflow In Restore In Android 4.3
I'm getting a IllegalStateException: underflow in restore exception, which is causing my application to crash. This started happening after android 4.3 update. On android 3.0 - 4.2
Solution 1:
The bug is in this section of your code:
if(bitMapWidth+mX<mCanvasWidth){
canvas.translate(bitMapWidth+mX, 0);
if(!mBitMapBuffer.isRecycled()){
canvas.drawBitmap(mBitMapBuffer, 0, 0, null);
}
canvas.restore();
}
You are calling restore()
without calling save()
first. You don't even need that call to translate()
either, you could just pass the x and y coordinates to the drawBitmap()
call.
Post a Comment for "Underflow In Restore In Android 4.3"