不要对dialog的dismiss和dismissDialog进行重写,不然会出现
java.lang.StackOverflowError
at java.lang.Thread.currentThread(Thread.java:470)
at java.lang.ThreadLocal.get(ThreadLocal.java:53)
at android.os.Looper.myLooper(Looper.java:162)
at com.android.org.chromium.base.ThreadUtils.runningOnUiThread(ThreadUtils.java:194)
at com.android.webview.chromium.WebViewChromium.checkNeedsPost(WebViewChromium.java:275)
at com.android.webview.chromium.WebViewChromium.stopLoading(WebViewChromium.java:651)
at android.webkit.WebView.stopLoading(WebView.java:943)
at com.xxxxxx.view.widget.UpdateApkDialog.destroy(UpdateApkDialog.java:101)
at com.xxxxxx.view.widget.UpdateApkDialog.dismissDialog(UpdateApkDialog.java:87)
内部代码:
@Override
public void dismiss() {
if (Looper.myLooper() == mHandler.getLooper()) {
dismissDialog();
} else {
mHandler.post(mDismissAction);
}
}
网友评论