--- android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/07/02 14:58:44 948 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2010/07/11 15:15:04 983 @@ -123,8 +123,8 @@ case ListNearest: startLookup(); break; - case ListSearch: - this.showDialogSafe(DLG_STATIONNAME); + case ListSearch: + showDialog(DLG_STATIONNAME); //TODO: this.showDialogSafe(DLG_STATIONNAME); break; case ListFavorites: startFavoriteLookup(); @@ -182,7 +182,8 @@ * - android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@436aaef8 is not valid; is your activity running? * - java.lang.IllegalArgumentException: View not attached to window manager */ - + + /* public void showDialogSafe(int id) { try { showDialog(id); @@ -213,7 +214,8 @@ Log.e("StationList", "builder.show() failed", e); } - } + }*/ + /* EOF rude and ugly dialog hack */ @@ -393,7 +395,7 @@ public void startLookup() { isRunning = true; dialogMessage = getString( stationlist_waitforlocation ); - showDialogSafe(DLG_PROGRESS); + showDialog(DLG_PROGRESS);//TODO:showDialogSafe(DLG_PROGRESS); locationLookup.locateStations(); stationsFetched.sendEmptyMessageDelayed(LOCATIONFIXTIMEOUT, GPS_TIMEOUT_MS); @@ -401,7 +403,7 @@ void startNameSearch(String name) { dialogMessage = getString( stationlist_findbyname ); - showDialogSafe(DLG_PROGRESS); + showDialog(DLG_PROGRESS);//TODO:showDialogSafe(DLG_PROGRESS); findStationsTask = new FindStationsTask(); findStationsTask.searchByName(name); @@ -413,7 +415,7 @@ if (favorites.size() > 0) { dialogMessage = getString( stationlist_loadfavorites ); - showDialogSafe(DLG_PROGRESS); + showDialog(DLG_PROGRESS);//TODO:showDialogSafe(DLG_PROGRESS); findStationsTask = new FindStationsTask(); findStationsTask.searchByIds( favorites.toString() ); @@ -428,7 +430,7 @@ void startLocatorTask() { dialogMessage = getString( stationlist_findingnearby ); - showDialogSafe(DLG_PROGRESS); + showDialog(DLG_PROGRESS);//TODO:showDialogSafe(DLG_PROGRESS); findStationsTask = new FindStationsTask(); findStationsTask.searchByLocation( locationLookup.getLocation() ); @@ -445,7 +447,7 @@ switch (msg.what) { case GOTLOCATION: - dismissDialogSafe(DLG_PROGRESS); + dismissDialog(DLG_PROGRESS);//TODO:dismissDialogSafe(DLG_PROGRESS); startLocatorTask(); location = GeoPair.fromLocation( locationLookup.getLocation() ); @@ -453,7 +455,7 @@ break; case NOPROVIDER: - dismissDialogSafe(DLG_PROGRESS); + dismissDialog(DLG_PROGRESS);//TODO:dismissDialogSafe(DLG_PROGRESS); MessageBox.showMessage(StationList.this, getString(stationlist_nolocationprovider), true ); //StationList.this.finish(); break; @@ -463,7 +465,7 @@ if (locationLookup.hasLocation()) { stationsFetched.sendEmptyMessage( GOTLOCATION ); } else { - dismissDialogSafe(DLG_PROGRESS); + dismissDialog(DLG_PROGRESS);//TODO:dismissDialogSafe(DLG_PROGRESS); AlertDialog.Builder builder = new AlertDialog.Builder(StationList.this); builder.setMessage( getString( stationlist_gpstimeout) ); @@ -480,7 +482,7 @@ dialog.dismiss(); } }); - builderShowSafe(builder); // builder.show() + builder.show();//TODO:builderShowSafe(builder); } } @@ -548,7 +550,7 @@ @Override protected void onPostExecute(Void result) { super.onPostExecute(result); - dismissDialogSafe(dialog); + dialog.dismiss();//TODO:dismissDialogSafe(dialog); if (success) { @@ -607,7 +609,7 @@ } }); - builderShowSafe(builder); // builder.show() + builder.show();//TODO:builderShowSafe(builder); } } }