异常提示信息
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() 会出错 但不影响功能