美文网首页
Android crash之Dialog

Android crash之Dialog

作者: 落后程序员 | 来源:发表于2020-04-20 14:45 被阅读0次

    不要对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);
            }
        }
    

    相关文章

      网友评论

          本文标题:Android crash之Dialog

          本文链接:https://www.haomeiwen.com/subject/hkhdihtx.html