How to let OnClick in ListView's Adapter call Activity's function

后端 未结 2 1577
小蘑菇
小蘑菇 2021-02-07 22:29

I have an Android application with a ListView in it, the ListView will setup fine but now I want a image in the ListView to be clickable. I do this by using 2 classes, the Activ

2条回答
  •  太阳男子
    2021-02-07 23:16

    Inside onClick() Do something like this:

    ((ParentClass) context).functionToRun();
    

提交回复
热议问题