Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Hang on all elements inside OnClickListener (TextView, ImageView, etc.)
Or parse the Id of the clicked View, as an option.
View.OnClickListener myOnlyhandler = new View.OnClickListener() {
public void onClick(View v) {
switch(v.getId()) {
case R.id.b1:
// it was the first button
break;
case R.id.b2:
// it was the second button
break;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question