Android - concurrent access to the canvas safely?
问题 I'm making a grid + tile activity where tiles need to move across the grid. The grid (and tiles) are being drawn on a surfaceView in a separate thread to the UI (UI deals with touch events and pushes them onto a queue for the grid to process). This is all fine. I have a toolbar from which I can drag tiles. The toolbar is a View which has been added to the relative layout (and runs on the UI thread). No matter how many times i use synchronize or try to safeguard the canvas from being written