java.lang.IllegalArgumentException: View not attached to window manager

公司项目线上bug:

java.lang.IllegalArgumentException: View not attached to window manager
    at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:406)
    at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:308)
    at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:79)
    at android.app.Dialog.dismissDialog(Dialog.java:323)
    at android.app.Dialog$1.run(Dialog.java:119)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5162)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)

stackoverflow.com上面相关内容:

http://stackoverflow.com/questions/22924825/view-not-attached-to-window-manager-crash

http://stackoverflow.com/questions/2745061/java-lang-illegalargumentexception-view-not-attached-to-window-manager

修改项目里面代码:

  protected void startProgressDialog() {
        //        showDialog(DIALOG_PROGRESS);
        if (progressDialog == null) {
            progressDialog = CommonDialogUtils.showLoadingDialog(this);
        }
        progressDialog.show();
    }

    protected void dismissProgressDialog() {
        //        removeDialog(DIALOG_PROGRESS);
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        }
    }

onDestory中调用dismissProgressDialog

 @Override protected void onDestroy() {super.onDestroy();
        dismissProgressDialog();
    }
时间: 2024-11-15 15:08:59

java.lang.IllegalArgumentException: View not attached to window manager的相关文章

decorview that was originally added here or java.lang.IllegalArgumentException: View not attached to window manager

使用Dialog的时候,没少出现下面这两个报错 12-11 17:47:49.776: E/WindowManager(11461): android.view.WindowLeaked: Activity TestActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{42204800 V.E..... R.....I. 0,0-640,164} that was originally

关于dialog引起的 java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView not attached to window manager 错误的分析

在跑Monkey测试的时候出现了一个比较特别的问题,先来看看Log: 1 // CRASH: com.meizu.media.painter (pid 12491) 2 3 // Short Msg: java.lang.IllegalArgumentException 4 5 // Long Msg: java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{2

java.lang.IllegalArgumentException: Requested window [email protected] 异常处理

晕死的错误,改了半天也没想到是这样的原因,基础正要呀... 先看一下警告信息: 07-07 08:32:19.540: WARN/WindowManager(74): Failed looking up window07-07 08:32:19.540: WARN/WindowManager(74): java.lang.IllegalArgumentException:Requested window [email protected] does not exist07-07 08:32:19

BottomSheetBehavior 之 java.lang.IllegalArgumentException: The view is not associated with BottomSheetBehavior

09-14 22:52:58.891 13674-13674/me.chunsheng.uberdriver E/AndroidRuntime: FATAL EXCEPTION: main Process: me.chunsheng.uberdriver, PID: 13674 java.lang.RuntimeException: Unable to start activity ComponentInfo{me.chunsheng.uberdriver/me.chunsheng.uberdr

view.setTag(key,Object) (java.lang.IllegalArgumentException: The key must be an application-specific resource id.)

转自: http://blog.csdn.net/brokge/article/details/8536906 setTag是android的view类中很有用的一个方法,可以用它来给空间附加一些信息,在很多场合下都得到妙用. setTag(Object tag)方法比较简单,这里主要谈一谈带两个参数的setTag方法. 官方的api文档中提到:" The specified key should be an id declared in the resources of the applica

android——fragment长时间home或者锁屏java.lang.IllegalArgumentException:No view found for id for....

在项目中遇到了这个问题.头痛了很久,总是无法重现,也不能很好的解决.总是在息屏后一段时间,就会报java.lang.IllegalArgumentException:No view found for id for....的问题,然后程序就崩溃了.相信很多朋友也有和我一样遇到这个问题的.那么这个问题怎么去解决呢? 在仔细研究fragment的manager后,下面是我发现的东西 什么鬼?怎么会有两个fragmentManager.这两个东西有什么关系呢? API上面说了一大堆,我这里简单总结一下

java.lang.IllegalArgumentException: parameter must be a descendant of this view

异常信息: java.lang.IllegalArgumentException: parameter must be a descendant of this view 错误原因: 发生这个错误主要是ListView或者其它ViewGroup等容器控件因为滑动而暂时移除子View,但却没有移除该子View上面的焦点Focus,所以在ListView滑动返回到原来的位置的时候没有恢复成原来的View,导致了该异常的产生,具体的源码分析可以查看参考链接[2] 解决方法: 解决办法就是清除掉List

java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting

将原有项目图片加载框架picasso改为glide,关于picasso和glide文档就自行查阅相关资料 显示 图片 例子 Glide.with(mContext).load(imageUrl).placeholder(defaultDrawable) .error(defaultDrawable).dontAnimate().into(view) 显示正常 因为项目中头像是圆形利用glide实用圆头像代码如下 Glide.with(mContext) .load(imageUrl) .dont

图片缩放时java.lang.IllegalArgumentException: pointerIndex out of range解决方案

版权声明:本文为博主原创文章,未经博主允许不得转载. 06-03 20:45:24.143: E/AndroidRuntime(1230): FATAL EXCEPTION: main06-03 20:45:24.143: E/AndroidRuntime(1230): java.lang.IllegalArgumentException: pointerIndex out of range06-03 20:45:24.143: E/AndroidRuntime(1230): at androi