I'm a little bit new using Butterknife and I'm having a problem. I want click on a textview and the open another activity. I know how to do that without using Butterknife, but this is what I did so far:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
}
@OnClick(R.id.tv_forgot_pass)
void forgotPassClick(){
Context mContext = LoginActivity.this;
Class nextActivity = ForgotPasswordActivity.class;
Intent mIntent = new Intent(mContext, nextActivity);
startActivity(mIntent);
finish();
}
}
My problem right now is I don't know how to use my onClick method, because if I put the that method inside the onCreate, the activity will open the next activity immediately. I tried to use tv_forgot_pass.setOnClickListener and didn't work. And also doesn't work in the xml because the method doesnt have a View as parameter.
It is okey what Im doing? or there is another way to set a clicklistner with Butterknife?
I'm going to explain why is not duplicated with this question
First, they are using and old version of Butterknife, I'm using the 8.8.1 version and the "duplicate question" is using 6.1.0. My version doesnt support InjectView(it's Bind now). Second, my question talks about click on a TextView, the other question talks about click on a button. It's similar but not the equal. And the most important, I read the "duplicate question" like an hour ago, before I asked my question and because I didn't find a solution to my problem I decided to post my question.