multithreading - Android - Looper.prepare() in a Thread vs Activity.runOnUIThread() -


my question quite simple i'm not able find satisfying answer. question is: thread run on ui thread if call looper.prepare() @ start of runnable?

i know looper messagequeue , exchanging data between threads make code run on ui thread?

below code explain:

@override public void onreceive(final context context, intent intent) { if(intent.getaction().equals(connectivitymanager.connectivity_action)) {          runnable runnable = new runnable() {             @override             public void run() {                 looper.prepare();                 // ... code ... //                 looper.loop();             }         };          thread thread = new thread(runnable);         thread.start();     } } 

no, not make thread run on ui thread. more info see: communicating ui thread


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -