首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ProgressDialog onProgressUpdate获取错误"DecorView: mWindow.mActivityCurrentConfig is null“

ProgressDialog onProgressUpdate获取错误"DecorView: mWindow.mActivityCurrentConfig is null“
EN

Stack Overflow用户
提问于 2021-01-13 00:14:56
回答 1查看 3.1K关注 0票数 0

我的ProgressDialog如下:

代码语言:javascript
运行
复制
ProgressDialog loading;

在AsyncTask中:

代码语言:javascript
运行
复制
       @Override
        protected void onPreExecute() {
            super.onPreExecute();
            if(loading!=null&&loading.isShowing())
                loading.dismiss();
            loading = new ProgressDialog(mContext);
            loading.setCancelable(true);
            loading.setIndeterminate(false);
            loading.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            loading.setMax(100);
            loading.setTitle("DownLoading: ");
            loading.setMessage("Please Wait.... ");
            loading.show();
        }

       @Override
        protected void onProgressUpdate(final Integer... values) {
           // super.onProgressUpdate(values);
            String fileSize = "";
            double m = (double) lengthOfFile / (1024 * 1024);
            DecimalFormat dec = new DecimalFormat("0.00");
            fileSize = dec.format(m);//.concat(" MB");
            loading.setMessage("loading: " + fileSize + " MB");
            loading.setProgress(values[0]);

        }

        @Override
        protected Void doInBackground(String... strings) {

                  //(downloading code goes here .....) 

                publishProgress((int) ((total * 100) / lengthOfFile));

           return null;
        }

我的logcat:

代码语言:javascript
运行
复制
E/DecorView: mWindow.mActivityCurrentConfig is null
E/DecorView: mWindow.mActivityCurrentConfig is null
I/chatty: uid=10293(com.alquran.tafhimul_quran) identical 1 line
E/DecorView: mWindow.mActivityCurrentConfig is null
D/ViewRootImpl@ec670c4[DownLoading: ]: ViewPostIme key 0
E/DecorView: mWindow.mActivityCurrentConfig is null
D/ViewRootImpl@ec670c4[DownLoading: ]: ViewPostIme key 1
D/ViewRootImpl@ec670c4[DownLoading: ]: dispatchDetachedFromWindow
W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
D/InputTransport: Input channel destroyed: '465d15 ', fd=136
D/ViewRootImpl@bc87539[_StartActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@27432[_StartActivity]
D/InputMethodManager: getNavigationBarColor() -855310
E/ViewRootImpl: sendUserActionEvent() mView returned.

那么,这里出了什么问题呢?我怎样才能摆脱logcat中的错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-28 23:06:37

我听到有人说可能是设备问题,你可以忽略它。我已经找了几个小时了,现在只要这个错误没有使设备崩溃,你就可以忽略它

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65687730

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档