--- android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/05/11 13:29:50 730 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/05/18 14:02:13 731 @@ -4,6 +4,7 @@ import java.util.List; +import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ListActivity; @@ -69,7 +70,8 @@ StationsFetchedHandler stationsFetched = new StationsFetchedHandler(); GeoPair location = new GeoPair(); - + + boolean isLaunchedforShortcut; boolean isRunning = false; List stations = new ArrayList(); @@ -111,6 +113,8 @@ listType = (WelcomeScreen.ListType) getIntent().getSerializableExtra("type"); setTitle(); + isLaunchedforShortcut = getIntent().getBooleanExtra("shortcut", false); + if (savedInstanceState == null) { @@ -354,9 +358,16 @@ StationBean station = stations.get(position); - Intent intent = new Intent(this, DepartureList.class); - intent.putExtra("stationbean", station); - startActivity(intent); + if (isLaunchedforShortcut == true) { + Intent i = new Intent(); + i.putExtra("station", station); + setResult(Activity.RESULT_OK, i); + finish(); + } else { + Intent intent = new Intent(this, DepartureList.class); + intent.putExtra("stationbean", station); + startActivity(intent); + } } /////////////////////////////////////////////////////////////