Permalink
Browse files

Added check for BadTokenException.

  • Loading branch information...
1 parent f38484d commit a85032ebf392e7f78d85cee78112636248ad8bb7 @johannilsson johannilsson committed Jul 10, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/com/markupartist/sthlmtraveling/DeviationsActivity.java
@@ -34,6 +34,7 @@
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
+import android.view.WindowManager.BadTokenException;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.SimpleAdapter;
@@ -332,7 +333,11 @@ protected void onPostExecute(ArrayList<Deviation> result) {
if (mWasSuccess) {
fillData(result);
} else {
- showDialog(DIALOG_GET_DEVIATIONS_NETWORK_PROBLEM);
+ try {
+ showDialog(DIALOG_GET_DEVIATIONS_NETWORK_PROBLEM);
+ } catch (BadTokenException e) {
+ Log.w(TAG, "Caught BadTokenException when trying to show network error dialog.");
+ }
}
}
}

0 comments on commit a85032e

Please sign in to comment.