How to set an onClickListener on an included layout?

person shubham sharmafolder_openAndroid, issueslocal_offer, access_time October 15, 2016

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);

warningComments are closed.