--- android/TrainInfo/src/dk/thoerup/traininfo/TimetableListAdapter.java 2009/09/30 09:14:27 365 +++ android/TrainInfo/src/dk/thoerup/traininfo/TimetableListAdapter.java 2009/10/29 19:27:29 490 @@ -16,6 +16,11 @@ LayoutInflater inflater; Context context; + @Override + public boolean isEnabled(int position) { + return false; + } + public TimetableListAdapter(Context context) { super(); this.context = context; @@ -50,7 +55,12 @@ public View getView(int position, View convertView, ViewGroup parent) { TimetableBean timetableBean = timetable.get(position); - View root = inflater.inflate(R.layout.timetablerow , parent, false); + View root; + if (convertView == null || convertView.getId() != R.id.TimetableRow) { + root = inflater.inflate(R.layout.timetablerow , parent, false); + } else { + root = convertView; + } TextView station = (TextView) root.findViewById(R.id.Station); station.setText(timetableBean.getStation()); @@ -70,8 +80,6 @@ arrival.setTextColor(fgcolor); departure.setTextColor(fgcolor); root.setBackgroundColor(bgcolor); - - Log.e("Current","current"); } return root;