Search code examples
androidlistviewclickable

Can i have Different Clickable Views in one single ListView Item?


I have a Custom ListView which has an ImageView and a TextView. and i implemented ListView.setOnItemSelectedListener();

But is these a way to make both the ImageView and TextView Clickable (Separately), I mean Click on ImageView must call ActivityA and Click on TextView must call ActivityB?


Solution

  • Yes you can do that inside the Adapter class itself. Just set the click listeners for ImageView and Textview in the Adapter class.