How to set an onClickListener on an included layout?

Replace findViewById(R.id.includeCallEnd0) with findViewById(R.id.includeCallEnd0).findViewById(R.id.phoneEnd) and it should work because you want to set the click listener on the ImageButton and not the whole layout Use the following function to set the OnClickListener once:

  Use applyListener(rootView, yourOnClickListener);

person shubham sharmaaccess_time October 15, 2016launch Read More