• Android对话框与Activity共存时的异常


    异常提示信息





    01-01 18:30:38.630: E/WindowManager(14537): Activity
    com.jack.outstock.activity.ManageCustomActivity has leaked window
    com.android.internal.policy.impl.PhoneWindow$DecorView@481801a8 that was
    originally added here

    01-01 18:30:38.630: E/WindowManager(14537): android.view.WindowLeaked:
    Activity com.jack.outstock.activity.ManageCustomActivity has leaked
    window com.android.internal.policy.impl.PhoneWindow$DecorView@481801a8
    that was originally added here

    01-01 18:30:38.630: E/WindowManager(14537):  at android.view.ViewRoot.<init>(ViewRoot.java:247)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.view.Window$LocalWindowManager.addView(Window.java:424)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.app.Dialog.show(Dialog.java:241)

    01-01 18:30:38.630: E/WindowManager(14537):  at com.jack.outstock.view.MyDialog.createAlertDialog(MyDialog.java:89)

    01-01 18:30:38.630: E/WindowManager(14537):  at
    com.jack.outstock.activity.ManageCustomActivity$1.handleMessage(ManageCustomActivity.java:41)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.os.Handler.dispatchMessage(Handler.java:99)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.os.Looper.loop(Looper.java:123)

    01-01 18:30:38.630: E/WindowManager(14537):  at android.app.ActivityThread.main(ActivityThread.java:4627)

    01-01 18:30:38.630: E/WindowManager(14537):  at java.lang.reflect.Method.invokeNative(Native Method)

    01-01 18:30:38.630: E/WindowManager(14537):  at java.lang.reflect.Method.invoke(Method.java:521)

    01-01 18:30:38.630: E/WindowManager(14537):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

    01-01 18:30:38.630: E/WindowManager(14537):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

    01-01 18:30:38.630: E/WindowManager(14537):  at dalvik.system.NativeStart.main(Native Method)





     

    出错原因:是 activity 和dialog同时显示,在直接finish activity时出错,



    解决方法:要先dialog.dismiss() 后activity.finish() ,如果直接finish() 会出错 但不影响功能

  • 相关阅读:
    TTreeView.OnCustomDrawItem
    xe Style
    delphi 加密 XOR
    ReportMachine 自定义代码 画细线
    XE 安装后C盘占用太大,C盘空间清理
    FireFox 书签 缓存 路径设置
    Android 照相
    Android手机与服务器(案例一) webservice
    win10/win7 笔记本 开启虚拟无线 批处理
    Delphi XE6打电话
  • 原文地址:https://www.cnblogs.com/arnoid/p/3207997.html
Copyright © 2020-2023  润新知