このコードに問題があります。ArrayAdapterのコンテンツを変更し、配列を含むオブジェクトへの引数として順序付けました。問題は、さまざまなもの、アイコン、背景の変更などでビュー(リストビュー)を変更することです。実際には、並べ替えを行うことで、一部のビューのプロパティが混在しているように見えます。たとえば、移動などのために別の背景に広がった背景:
public class IconLVAdapter extends ArrayAdapter<Datos> {
private List<Datos> objetos;
private boolean online;
public IconLVAdapterBuses(Context context, int textViewResourceId, List<Datos> objetos, boolean online) {
super(context, textViewResourceId, objetos);
this.objetos = objetos;
this.online = online;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.rowlist, null);
}
Datos o = objetos.get(position);
if (o != null) {
TextView tvNum = (TextView) v.findViewById(R.id.num);
if (o.getpOrigen()==null && tvNum!= null)
tvNum.setText(o.getnum());
else{
************** omitido **************
}
}
return v;
}
public void refreshArray(){
this.sort(new Comparator<Datos>() {
public int compare(Datos object1, Datos object2) {
return object1.compareTo(object2);
};
});
this.notifyDataSetChanged();
}
何か案は?ありがとう