11 |
import android.widget.Toast; |
import android.widget.Toast; |
12 |
import dk.thoerup.android.traininfo.common.StationEntry; |
import dk.thoerup.android.traininfo.common.StationEntry; |
13 |
import dk.thoerup.traininfo.WelcomeScreen.ListType; |
import dk.thoerup.traininfo.WelcomeScreen.ListType; |
14 |
|
import dk.thoerup.traininfo.util.StationEntryCsv; |
15 |
|
|
16 |
public class ShortcutActivity extends Activity { |
public class ShortcutActivity extends Activity { |
17 |
|
|
68 |
String stationStr = intent.getStringExtra("station"); |
String stationStr = intent.getStringExtra("station"); |
69 |
|
|
70 |
if (stationStr != null) { //haven't reproduced it, but got a stacktrace where stationStr apparently was null |
if (stationStr != null) { //haven't reproduced it, but got a stacktrace where stationStr apparently was null |
71 |
StationEntry station = StationEntry.fromCSV(stationStr); |
StationEntry station = StationEntryCsv.fromCSV(stationStr); |
72 |
|
|
73 |
Intent launcher = new Intent( this, DepartureList.class ); |
Intent launcher = new Intent( this, DepartureList.class ); |
74 |
launcher.putExtra("stationbean", station); |
launcher.putExtra("stationbean", station); |
110 |
// First, set up the shortcut intent. |
// First, set up the shortcut intent. |
111 |
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); |
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); |
112 |
shortcutIntent.setClassName(this, this.getClass().getName()); |
shortcutIntent.setClassName(this, this.getClass().getName()); |
113 |
shortcutIntent.putExtra("station", station.toCSV() ); |
shortcutIntent.putExtra("station", StationEntryCsv.toCSV(station) ); |
114 |
|
|
115 |
|
|
116 |
// Then, set up the container intent (the response to the caller) |
// Then, set up the container intent (the response to the caller) |