我使用自定义适配器在listview的行中有三个textview,并且在单击该行时,我想执行所选文本视图的click事件.
下面是我点击事件的示例代码.在第一次单击时,将设置侦听器,并且仅在第二次单击时发生实际的单击事件,我想在第一次单击时找到它.可能吗?
listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapter,View view,int pos,long id) { final Order orderBooking = (Order)adapter.getItemAtPosition(pos); // SKU listener final TextView tvSkuId = (TextView) view.findViewById(orderBooking.getSelectedSkuId()); tvSkuId.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { onSkuClickListener(view,orderBooking); } }); // SO listener final TextView tvSoId = (TextView) view.findViewById(orderBooking.getSelectedSoId()); tvSoId.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { onSoClickListener(view,orderBooking); } }); // OR listener final TextView txtOrId = (TextView) view.findViewById(orderBooking.getSelectedOrId()); //onOrClickListener(view,orderBooking); txtOrId.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { onOrClickListener(view,orderBooking); } }); } });