9
I have a ListView that is filled by a Custom Adapter with a specific Layout. The Adapter is mapped to a HashMap with the specific Elements that contains the Data for each ListView Element.
The Data in the hashMap is correct, but the ListView repeats to draw every 6'th the same 6'th Elements again, till it reaches the end of the Map??
My Display allows to display 5 items, if you sroll a litte it's 6 items.
Here is the Code of the Adapter, the relevant Code of the ListActivity and the layout file of the ListView.
Please help, I've no Idea why this happens.
package de.View;
import java.util.ArrayList;
import java.util.Map;
import de.carSync.R;
import de.Common.Date_Conversion;
import de.Common.GUI_Output;
import de.Model.DriversLog.Fahrt;
import de.Model.DriversLog.Geladene_Fahrten;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
public class Fahrten_List_Adapter extends BaseAdapter{
private static String TAG = "Fahrten_List_Adapter";
private Map<Integer,Fahrt> fahrten_Liste;
private final LayoutInflater mLayoutInflater;
int zeilen_Layout;
public Fahrten_List_Adapter(Context ctx, Map<Integer,Fahrt> f_l, int zeilen_Layout){
this.zeilen_Layout = zeilen_Layout;
fahrten_Liste = f_l;
mLayoutInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return fahrten_Liste.size();
}
@Override
public Object getItem(int pos) {
return fahrten_Liste.get(pos);
}
@Override
public long getItemId(int pos) {
return 0;
}
public void clear(){
fahrten_Liste.clear();
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
if(con