This is because the views are updated only when onDraw () is called, which is due to screen activity (for example, you touch it) or when it does this programmatically.
You want to force: use the invalidate () method inherited from View.
If the deletion happens inside you SurfaceView, just write invalidate () AFTER you finish the deletion. If this happens outside, then just do surfaceViewInstance.invalidate ().
Hope this helps
source share