Android: When I set an OnClickListener for a ListView

后端 未结 4 2051
鱼传尺愫
鱼传尺愫 2021-01-12 23:34
    lv.setOnClickListener(new OnClickListener(){
        public void onClick(View v){

        }
    });

Does v refer to the ListView

4条回答
  •  醉梦人生
    2021-01-13 00:01

    I believe that v refers to the whole ListView. To add a click handler for an item, you want to use AdapterView.setOnItemClickListener.

提交回复
热议问题