[Solved] Listview onclicklistener for only one item in android [closed]


@Override
public View getView(int position, View convertView, ViewGroup parent) {

ViewHolder holder = null;

if (convertView == null) {

    holder = new ViewHolder();
    LayoutInflater li = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView = li.inflate(resource, parent, false);

    holder.imageview= (ImageView)convertView.findViewById(R.id.imageview);

    convertView.setTag(holder);

} else {

    holder = (ViewHolder) convertView.getTag();
}

holder.imageview.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
       // handle click
    }
});

return convertView;
}

static class ViewHolder {

ImageView imageview;
}

0

solved Listview onclicklistener for only one item in android [closed]