Using Butter Knife in Custom BaseAdapter SubClass Results in “Unable to inject views” error

后端 未结 5 846
甜味超标
甜味超标 2021-02-18 13:59

I\'m attempting to use Butter Knife to simplify creation of a custom BaseAdapter class. I\'m following the example here: http://jakewharton.github.io/butterknife/ under the \"A

5条回答
  •  孤街浪徒
    2021-02-18 14:16

    Check if your @InjectViews has correct type. I've used ImageView instead of LinearLayout. That might be your problem too.

    Update:

    Make sure you are not using ButterKnife's @OnItemClick(R.id.non_list_view) with a non ListView. I was using it for a android.support.v7.widget.RecyclerView which was causing following exception:

    java.lang.RuntimeException: Unable to inject views for MyFragment{... id=.... android:switcher:...}
    

提交回复
热议问题