i have used toolbar so now i want to apply click event over logo icon how can i get this event?
here is some coding stuff that i have done
Toolbar to
I was asking myself the same question and came across this. I took a similar approach to Nikola Despotoski but with a different implementation.
Instead of the method, what I did was:
// Set drawable
toolbar.setLogo(ContextCompat.getDrawable(context, R.drawable.logo));
// Find logo
View view = toolbar.getChildAt(1);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Perform actions
}
});
Slightly hack-ish, but will come back review it a bit later. Sharing for discussion purposes.