报错
Android java.lang.RuntimeException: Can'tcreate handler inside thread that has not called Looper.prepare()
因为activity的主线程是自己创建消息队列的,所以在Activity中新建Handler时,不需要先调用Looper.prepare()。
原因是非主线程中默认没有创建Looper对象,如果需要在子线程中创建Handler对象,就需要先调用Looper.prepare()初始化Looper,Looper.loop()启动该线程的消息队列。