What Is The Difference Between Runonuithread Method And Handler? Which One Is The Best To Use?
I usually use the method runOnUiThread (new Runnable () { @Override public void run () { } }); to launch some prcess in the main thread. just recently I disco
Solution 1:
Both are actually same. Both runOnUiThread
and Handler#post
runs the passed Runnable
in the UI Thread.
FYI, you can also execute any Runnable
on UI Thread with the help of any View
by calling the method View#post(runnable)
.
Since all approaches uses Handler
internally, all are same and there won't be any difference in using any of these.
Post a Comment for "What Is The Difference Between Runonuithread Method And Handler? Which One Is The Best To Use?"