Looper, Thread and Handler
Can't create handler inside thread that has not called Looper.prepare()
new Thread(){
Handler handler = null;
public void run() {
handler = new Handler();
};
}.start();
- One thread had the only one Looper and MessageQueue.
- Threads exchanged data(message) via Handler.
- You can also use "HandlerThread". It combined Thread, Looper and MessageQueue.
- RxJava is the best solution to handle Android Thread.
http://blog.csdn.net/bboyfeiyu/article/details/38555547
http://mindtherobot.com/blog/159/android-guts-intro-to-loopers-and-handlers/
http://givemepass-blog.logdown.com/posts/296790-how-to-use-handlerthread
Author And Source
この問題について(Looper, Thread and Handler), 我々は、より多くの情報をここで見つけました https://qiita.com/moonlightbox/items/a04630f8c85edc2d9050著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .