How to Click on the each individual position using base adapter

后端 未结 5 1721
我在风中等你
我在风中等你 2020-12-12 07:23

I am using the base adapter , i have list which contains list with the text view (means left side sent items and below to that ,right side received items, i want to click o

5条回答
  •  温柔的废话
    2020-12-12 08:18

    there is onItemClickListener in android, you can use that

    ListView listview = (ListView)findViewById(R.id.yourlist);
    listview.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView parent, View view, int position, long id) {
            // @todo
        }
    });
    

    For individual view in you list item, you can always add click listener in getView method.

提交回复
热议问题