5 |
import java.util.Map; |
import java.util.Map; |
6 |
|
|
7 |
import android.content.Context; |
import android.content.Context; |
8 |
|
import android.util.Log; |
9 |
import android.view.LayoutInflater; |
import android.view.LayoutInflater; |
10 |
import android.view.View; |
import android.view.View; |
11 |
import android.view.ViewGroup; |
import android.view.ViewGroup; |
63 |
public View getView(int position, View convertView, ViewGroup parent) { |
public View getView(int position, View convertView, ViewGroup parent) { |
64 |
DepartureBean station = departures.get(position); |
DepartureBean station = departures.get(position); |
65 |
|
|
66 |
View root = inflater.inflate(R.layout.departurerow , parent, false); |
|
67 |
|
View root; |
68 |
|
if (convertView == null || convertView.getId() != R.id.DepartureRow ) { |
69 |
|
root = inflater.inflate(R.layout.departurerow , parent, false); |
70 |
|
} else { |
71 |
|
root = convertView; |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
((TextView) root.findViewById(R.id.Time)).setText(station.getTime()); |
((TextView) root.findViewById(R.id.Time)).setText(station.getTime()); |
76 |
((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); |
((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); |