Canvas object must be the same instance that was previously returned by lockCanvas
问题 I have a custom SurfaceView with a method doDraw() that draws a background and a bitmap. The problem is when I run this I get an error Caused by: java.lang.IllegalArgumentException: canvas object must be the same instance that was previously returned by lockCanvas I don't see why this is happening. I don't declare any other canvases anywhere else in my code. I only have two other classes, MainActivity and SurfaceViewExample. MainActivity just has an intent to open SurfaceViewExample, and