How to update the screen before the method ends with the droid?

If I changed one source ImageViewto another, (and thus changing the image), but then more changes will occur inside the method, etc. How can I get it to update to show the changes before the method completes? (Since the expectation that the method ends to show modified images is not suitable for my purposes at all)

+3
source share
1 answer

There's a very similar question that has a great answer (and a link to another similar question) right here .

Basically, if you do not create a thread yourself, you are working in a user interface thread. Invalidate / sleep just pauses the rendering / input of / etc. Yours redraw()is only called in the user interface thread after the current function exits. Do you want to separate the two or use a lower level technique ( postInvalid()in a different thread or SurfaceVieww / repaint()respectively).

+2
source

Source: https://habr.com/ru/post/1771764/


All Articles