Search code examples
javaandroidbutterknife

Unable to use findById in ButterKnife


I'm getting this error with ButterKnife:

error: cannot find symbol method findById(View,int)

TextView tvHeaderTextOne = ButterKnife.findById(headerView, R.id.tv_header_text_one);

After updating to Butterknife 10 getting the error unable to findById.


Solution

  • define prop

    @BindView( R.id.tv_header_text_one)
    protected TextView tx ;
    

    in OnCreate Method :

    ButterKnife.bind(this,yourview);