4 |
import java.util.ArrayList; |
import java.util.ArrayList; |
5 |
import java.util.List; |
import java.util.List; |
6 |
|
|
7 |
|
import android.app.Activity; |
8 |
import android.app.AlertDialog; |
import android.app.AlertDialog; |
9 |
import android.app.Dialog; |
import android.app.Dialog; |
|
import android.app.ListActivity; |
|
10 |
import android.app.ProgressDialog; |
import android.app.ProgressDialog; |
11 |
import android.content.DialogInterface; |
import android.content.DialogInterface; |
12 |
import android.content.Intent; |
import android.content.Intent; |
13 |
import android.os.AsyncTask; |
import android.os.AsyncTask; |
14 |
import android.os.Bundle; |
import android.os.Bundle; |
15 |
import android.util.Log; |
import android.widget.ListView; |
16 |
import android.widget.TextView; |
import android.widget.TextView; |
17 |
import dk.thoerup.traininfo.provider.ProviderFactory; |
import dk.thoerup.traininfo.provider.ProviderFactory; |
18 |
import dk.thoerup.traininfo.provider.TimetableProvider; |
import dk.thoerup.traininfo.provider.TimetableProvider; |
19 |
import dk.thoerup.traininfo.util.MessageBox; |
import dk.thoerup.traininfo.util.MessageBox; |
20 |
|
|
21 |
public class TimetableList extends ListActivity { |
public class TimetableList extends Activity { |
22 |
|
|
23 |
private static final int DLG_PROGRESS = 8000; |
private static final int DLG_PROGRESS = 8000; |
24 |
DepartureBean departure; |
DepartureBean departure; |
37 |
provider = ProviderFactory.getTimetableProvider(); |
provider = ProviderFactory.getTimetableProvider(); |
38 |
|
|
39 |
adapter = new TimetableListAdapter(this); |
adapter = new TimetableListAdapter(this); |
40 |
setListAdapter(adapter); |
|
41 |
|
ListView lv = (ListView) findViewById(R.id.List); |
42 |
|
lv.setAdapter(adapter); |
43 |
|
|
44 |
|
|
45 |
Intent launchedBy = getIntent(); |
Intent launchedBy = getIntent(); |
46 |
departure = (DepartureBean) launchedBy.getSerializableExtra("departure"); |
departure = (DepartureBean) launchedBy.getSerializableExtra("departure"); |
49 |
((TextView)findViewById(R.id.Status)).setText(departure.getStatus()); |
((TextView)findViewById(R.id.Status)).setText(departure.getStatus()); |
50 |
((TextView)findViewById(R.id.Note)).setText(departure.getNote()); |
((TextView)findViewById(R.id.Note)).setText(departure.getNote()); |
51 |
((TextView)findViewById(R.id.Updated)).setText(departure.getLastUpdateString()); |
((TextView)findViewById(R.id.Updated)).setText(departure.getLastUpdateString()); |
52 |
|
|
53 |
|
|
54 |
if (savedInstanceState == null) { |
if (savedInstanceState == null) { |
55 |
startTimetableFetcher(); |
startTimetableFetcher(); |