Fragmentation icon indicating copy to clipboard operation
Fragmentation copied to clipboard

ButterKnife空指针问题

Open SuperKe opened this issue 7 years ago • 1 comments

在onCreateView中bindView在onSupportVisible请求接口,有可能会报控件空指针

SuperKe avatar Feb 28 '19 13:02 SuperKe

onSupportVisible()是post到主线程消息队列的,时机晚于onCreateView

在onCreateView中bindView在onSupportVisible 请求接口

“请求接口” 排查是否因关闭页面,而请求还在发送中,导致解绑View的butterKnife导致空指针;

解决方案:在关闭页面是取消请求

YoKeyword avatar Jun 07 '19 08:06 YoKeyword