当我单击列表视图中的一行时,holder.four 变得可见,然后当我第二次单击时它变得不可见。当我第三次单击以使其可见时,它不起作用。我认为 vi onclick 侦听器中的可运行线程存在问题。有人可以告诉我如何解决这个问题。
***vi = inflater.inflate(R.layout.row_operation, null);
holder = new ViewHolder();
holder.one = (TextView) vi.findViewById(R.id.text_on);
holder.two = (TextView) vi.findViewById(R.id.text_messag);
holder.three = (TextView) vi.findViewById(R.id.text_th);
holder.four = (TextView) vi.findViewById(R.id.text_details);
vi.setTag(holder);
holder.one.setText(data.get(position).getmontant()+" EUR");
holder.two.setText((data.get(position).getlibelle()));
holder.three.setText(data.get(position).getdateValeur());
holder.four.setVisibility(View.GONE);
holder.four.setText(data.get(position).getdateOper());
//clickEvent();
vi.setOnClickListener(this);
return vi;
}
/*
* On Click event
*/
@Override
public void onClick(final View v){
v.post(new Runnable() {
@Override
public void run() {
ViewHolder holder = ((ViewHolder)v.getTag());
holder.four.setVisibility(View.VISIBLE);
if(selectedHolder != null)
holder.four.setVisibility(View.GONE);
selectedHolder = holder;
}
});
}
} *