I have an Activity which implements OnClickListener, and I am handling onClick event as below code:
void onClick(View v) {
final int id = v.getId();
switch (id) {
case R.id.xxx:
break;
}
}
and now I have a Toolbar also, So I want to handle toolbar navigation button click event in this way too:
toolbar.setNavigationOnClickListener(this);
but I don't know the id of the toolbar navigation button. How can I get it?