原文:java.lang.IllegalStateException: Required view 'text1' with ID 2131492943 for field 'mText' was not found. If this view is optional add '@Nullable' annotation

使用ButterKnife . 的时候遇到这个问题 很明显空指针问题 按照提示添加 造成原因如下: ButterKnife 没有 ButterKinfe.Bind this 或者ButterKnife.Bind this,view 我是在BaseActivity中添加ButterKnife.Bind this 报错的 果然还是我太天真了这样是找不到的。 ...

2016-07-22 11:05 0 7524 推荐指数:

查看详情

kotlin记一次报错:java.lang.IllegalStateException: recycler_View must not be null

在Activity中创建一个RecyclerView可以正常创建以及显示,然后换了在 Fragment 中一直报错说不能为空。 然后上网查了一下: 结论得出,我们通常把initView方法写在onCreateView方法中,但是这个时候view可能并没有返回,所以就找不到了,所以我 ...

Wed Sep 02 02:01:00 CST 2020 0 1266
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM