Only the original thread that created a view hierarchy can touch its views.

时间:2024-03-27 10:19:17

记录:

报错:Only the original thread that created a view hierarchy can touch its views.

Only the original thread that created a view hierarchy can touch its views.


分析:更新UI 线程不安全。不在主线上

原因:触发消息初始化来源于第三方框架的回调,为子线程回调。

解决方案:在第三方回调处出使用handle来转发更新UI消息。