Run error dialog on UI thread.

This commit is contained in:
Bryce Curtis 2011-10-25 11:44:06 -05:00
parent 60b5d42324
commit 12816aa8f3

View File

@ -1531,7 +1531,7 @@ public class DroidGap extends PhonegapActivity {
* @param description A String describing the error. * @param description A String describing the error.
* @param failingUrl The url that failed to load. * @param failingUrl The url that failed to load.
*/ */
public void onReceivedError(int errorCode, String description, String failingUrl) { public void onReceivedError(final int errorCode, final String description, final String failingUrl) {
final DroidGap me = this; final DroidGap me = this;
// If errorUrl specified, then load it // If errorUrl specified, then load it
@ -1548,8 +1548,12 @@ public class DroidGap extends PhonegapActivity {
// If not, then display error dialog // If not, then display error dialog
else { else {
me.appView.setVisibility(View.GONE); me.runOnUiThread(new Runnable() {
me.displayError("Application Error", description + " ("+failingUrl+")", "OK", true); public void run() {
me.appView.setVisibility(View.GONE);
me.displayError("Application Error", description + " ("+failingUrl+")", "OK", true);
}
});
} }
} }