underflow in restore in android 4.3

后端 未结 2 1846
暗喜
暗喜 2021-02-14 21:20

I\'m getting a IllegalStateException: underflow in restore exception, which is causing my application to crash. This started happening after android 4.3 update.

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-14 21:49

    The bug is in this section of your code:

        if(bitMapWidth+mX

    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.

提交回复
热议问题