1 |
package dk.thoerup.traininfo; |
package dk.thoerup.traininfo; |
2 |
|
|
3 |
import android.app.ListActivity; |
import android.app.ListActivity; |
4 |
|
import android.content.Intent; |
5 |
import android.os.Bundle; |
import android.os.Bundle; |
6 |
import android.widget.TextView; |
import android.widget.TextView; |
7 |
|
|
8 |
public class TimetableList extends ListActivity { |
public class TimetableList extends ListActivity { |
9 |
|
|
10 |
|
DepartureBean departure; |
11 |
|
|
12 |
@Override |
@Override |
13 |
protected void onCreate(Bundle savedInstanceState) { |
protected void onCreate(Bundle savedInstanceState) { |
14 |
super.onCreate(savedInstanceState); |
super.onCreate(savedInstanceState); |
15 |
setContentView(R.layout.timetablelist); |
setContentView(R.layout.timetablelist); |
16 |
|
|
17 |
|
Intent launchedBy = getIntent(); |
18 |
|
departure = (DepartureBean) launchedBy.getSerializableExtra("departure"); |
19 |
|
|
20 |
|
((TextView)findViewById(R.id.Train)).setText(departure.getTrainNumber()); |
21 |
|
((TextView)findViewById(R.id.Status)).setText(departure.getStatus()); |
22 |
|
((TextView)findViewById(R.id.Note)).setText(departure.getNote()); |
23 |
|
((TextView)findViewById(R.id.Updated)).setText(departure.getLastUpdateString()); |
24 |
} |
} |
25 |
/* |
|
26 |
* case DLG_DETAILS: |
/* case DLG_DETAILS: |
27 |
DepartureBean currentDeparture = departures.get(selectedItemId); |
DepartureBean currentDeparture = departures.get(selectedItemId); |
28 |
((TextView)dialog.findViewById(R.id.Time)).setText(currentDeparture.getTime()); |
((TextView)dialog.findViewById(R.id.Time)).setText(currentDeparture.getTime()); |
29 |
((TextView)dialog.findViewById(R.id.Train)).setText(currentDeparture.getTrainNumber()); |
((TextView)dialog.findViewById(R.id.Train)).setText(currentDeparture.getTrainNumber()); |