Activity有两个handler,第一个发消息,第二个收不到。他们通过what区分。
普通子线程中不能new handler,会报错
handlerthread中能new handler(looper lp)
普通线程是没有looper的
子线程中构造hanler,传入主线程的looper,向主线程发消息
普通子线程中不能new handler,会报错
handlerthread中能new handler(looper lp)
普通线程是没有looper的
子线程中构造hanler,传入主线程的looper,向主线程发消息