原文: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