how to make an imageview clickable in an listview

后端 未结 6 943
一整个雨季
一整个雨季 2020-12-18 11:44

Hi i have created a basic listview and added a textview and imageview in it.



        
6条回答
  •  生来不讨喜
    2020-12-18 12:21

    Rishi,

    Try something like the following:

    ImageView myImg= (ImageView) findViewById(R.id.icon);
    myImg.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                    //Launch Intent or whatever you want here
                }
            });
    

提交回复
热议问题