This should just prevent it from crashing. The actual output will not get the result you want. This is because you are artificially destroying the draw mechanism of View.
If you need to redraw, when View#onTouchEvent(...), set the parameters required for draw (non-canvas), and then call View#invalidate() , notification View#onTouchEvent(...)时, 设置好draw需要的参数(非canvas), 然后再调用 View#invalidate(), 通知Viewredraw.
If you need to redraw, when
View#onTouchEvent(...)
, set the parameters required for draw (non-canvas), and then callView#invalidate()
, notificationView#onTouchEvent(...)
时, 设置好draw需要的参数(非canvas), 然后再调用View#invalidate()
, 通知View
redraw.