当我单击 listView 项目上的编辑图像时。我把 onClickEvent 放在我的适配器上。我想通过我的主要活动获取该文本视图的位置或名称。
请给点建议好吗?
public View getView(final int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
final Context context = getContext();
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.transferlistviewitem_layout, null);
}
TransferEntry item = transferList.get(position);
if (item != null) {
TextView name = (TextView) v.findViewById(R.id.transferName_textView);
ImageView delete = (ImageView) v.findViewById(R.id.edit_icon);
delete.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
t.setText(transferList.get(position).getItemName());
}
});*/