Adding clickListener
to ImageView
is a cleaner way. In the button, you may face issues like, image not being bordered properly. It can be done with changes in xml, but its an overhead.
ImageView imageView = (ImageView) findViewById(R.id.<ImageViewId>);
imageView.setOnClickListener(this);
In the onClick(View view)
method, handle the click event.