mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Run error dialog on UI thread.
This commit is contained in:
parent
60b5d42324
commit
12816aa8f3
@ -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);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user