An android project with view binding and I notice having viewBinding.root.post { @Runnable }
.
But I don't know how this runnable will effect to my root view. Can you help me :'(
An android project with view binding and I notice having viewBinding.root.post { @Runnable }
.
But I don't know how this runnable will effect to my root view. Can you help me :'(
Because post function is available in the view class, you can use it to perform any task on the same view. like redraw, invalidate, visibility etc, and viewbinding will get you the view object for your root view.
here is some information from resource documentation
Causes the Runnable to be added to the message queue. The runnable will be run on the user interface thread.
Params: action – The Runnable that will be executed.
Returns: Returns true if the Runnable was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting.