错误:java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{8668d93 V.E..... R.....I. 0,0-0,0} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:417)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:343)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:121)
at android.app.Dialog.dismissDialog(Dialog.java:355)
at android.app.Dialog$1.run(Dialog.java:123)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5743)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1077)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:843)
public class BaseDialog extends Dialog {
private Context mContext;
WeakReference<Activity> weakReference = new WeakReference<Activity>(
(Activity) mContext);
protected BaseDialog(Context context) {
super(context);
this.mContext = context;
}
protected BaseDialog(Context context, int theme) {
super(context, theme);
this.mContext = context;
}
@Override
public void show() {
if (DialogUtil.isLiving((Activity) mContext)) {
super.show();
}
}
@Override
public void dismiss() {
if (DialogUtil.isShowing(this)
&& DialogUtil.isExist_Living(weakReference)) {
super.dismiss();
}
}
}