8 |
import android.view.View.OnClickListener; |
import android.view.View.OnClickListener; |
9 |
import android.widget.Button; |
import android.widget.Button; |
10 |
import android.widget.TextView; |
import android.widget.TextView; |
11 |
|
import android.widget.Toast; |
12 |
import dk.thoerup.android.traininfo.common.StationBean.StationEntry; |
import dk.thoerup.android.traininfo.common.StationBean.StationEntry; |
13 |
import dk.thoerup.traininfo.WelcomeScreen.ListType; |
import dk.thoerup.traininfo.WelcomeScreen.ListType; |
14 |
|
|
65 |
} else { |
} else { |
66 |
//launched by the user clicking on the shortcut |
//launched by the user clicking on the shortcut |
67 |
String stationStr = intent.getStringExtra("station"); |
String stationStr = intent.getStringExtra("station"); |
68 |
StationEntry station = StationEntry.fromCSV(stationStr); |
|
69 |
|
if (stationStr != null) { //haven't reproduced it, but got a stacktrace where stationStr apparently was null |
70 |
|
StationEntry station = StationEntry.fromCSV(stationStr); |
71 |
|
|
72 |
Intent launcher = new Intent( this, DepartureList.class ); |
Intent launcher = new Intent( this, DepartureList.class ); |
73 |
launcher.putExtra("stationbean", station); |
launcher.putExtra("stationbean", station); |
74 |
startActivityForResult(launcher, SHOW_DEPARTURES); |
startActivityForResult(launcher, SHOW_DEPARTURES); |
75 |
|
} else { |
76 |
|
Toast.makeText(this, "Invalid TrainInfo shortcut - please delete and re-create", Toast.LENGTH_LONG).show(); |
77 |
|
} |
78 |
} |
} |
79 |
} |
} |
80 |
|
|