android.view.WindowLeaked: Activity com.android.browser.AddBookmarkPage has leaked window com.androi
2012-02-01 19:01
483 查看
02-01 17:17:08.078: E/WindowManager(550): android.view.WindowLeaked: Activity com.android.browser.AddBookmarkPage has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@410adf10 that was originally added here
02-01 17:17:08.078: E/WindowManager(550): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:344)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:267)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140)
02-01 17:17:08.078: E/WindowManager(550): at android.view.Window$LocalWindowManager.addView(Window.java:537)
02-01 17:17:08.078: E/WindowManager(550): at android.app.Dialog.show(Dialog.java:278)
02-01 17:17:08.078: E/WindowManager(550): at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
02-01 17:17:08.078: E/WindowManager(550): at com.android.browser.AddBookmarkPage.save(AddBookmarkPage.java:917)
02-01 17:17:08.078: E/WindowManager(550): at com.android.browser.AddBookmarkPage.onClick(AddBookmarkPage.java:263)
02-01 17:17:08.078: E/WindowManager(550): at android.view.View.performClick(View.java:3511)
02-01 17:17:08.078: E/WindowManager(550): at android.view.View$PerformClick.run(View.java:14105)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Handler.handleCallback(Handler.java:605)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Handler.dispatchMessage(Handler.java:92)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Looper.loop(Looper.java:137)
02-01 17:17:08.078: E/WindowManager(550): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-01 17:17:08.078: E/WindowManager(550): at java.lang.reflect.Method.invokeNative(Native Method)
02-01 17:17:08.078: E/WindowManager(550): at java.lang.reflect.Method.invoke(Method.java:511)
02-01 17:17:08.078: E/WindowManager(550): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-01 17:17:08.078: E/WindowManager(550): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-01 17:17:08.078: E/WindowManager(550): at dalvik.system.NativeStart.main(Native Method)
02-01 17:17:11.879: W/ThrottleService(97): unable to find stats for iface rmnet0
该错误是由于在Activity中创建并显示了Alertdialog,但Activity被提前结束,导致Alertdialog所引用的context为空,
解决办法为,1,将dialog采用oncreateDialog的方式创建,交由系统维护。 his method is deprecated. Use the new
2.在onDestroy()方法中将该alertdialog dismiss掉。
3 保持activity的存活
02-01 17:17:08.078: E/WindowManager(550): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:344)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:267)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215)
02-01 17:17:08.078: E/WindowManager(550): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140)
02-01 17:17:08.078: E/WindowManager(550): at android.view.Window$LocalWindowManager.addView(Window.java:537)
02-01 17:17:08.078: E/WindowManager(550): at android.app.Dialog.show(Dialog.java:278)
02-01 17:17:08.078: E/WindowManager(550): at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
02-01 17:17:08.078: E/WindowManager(550): at com.android.browser.AddBookmarkPage.save(AddBookmarkPage.java:917)
02-01 17:17:08.078: E/WindowManager(550): at com.android.browser.AddBookmarkPage.onClick(AddBookmarkPage.java:263)
02-01 17:17:08.078: E/WindowManager(550): at android.view.View.performClick(View.java:3511)
02-01 17:17:08.078: E/WindowManager(550): at android.view.View$PerformClick.run(View.java:14105)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Handler.handleCallback(Handler.java:605)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Handler.dispatchMessage(Handler.java:92)
02-01 17:17:08.078: E/WindowManager(550): at android.os.Looper.loop(Looper.java:137)
02-01 17:17:08.078: E/WindowManager(550): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-01 17:17:08.078: E/WindowManager(550): at java.lang.reflect.Method.invokeNative(Native Method)
02-01 17:17:08.078: E/WindowManager(550): at java.lang.reflect.Method.invoke(Method.java:511)
02-01 17:17:08.078: E/WindowManager(550): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-01 17:17:08.078: E/WindowManager(550): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-01 17:17:08.078: E/WindowManager(550): at dalvik.system.NativeStart.main(Native Method)
02-01 17:17:11.879: W/ThrottleService(97): unable to find stats for iface rmnet0
该错误是由于在Activity中创建并显示了Alertdialog,但Activity被提前结束,导致Alertdialog所引用的context为空,
解决办法为,1,将dialog采用oncreateDialog的方式创建,交由系统维护。 his method is deprecated. Use the new
DialogFragmentclass with
FragmentManagerinstead; this is also available on older platforms through the Android compatibility packageecms.com
2.在onDestroy()方法中将该alertdialog dismiss掉。
3 保持activity的存活
相关文章推荐
- android.view.WindowLeaked: Activity com.xty.activity.ActivityMainPage has leaked window com.android.
- android.view.WindowLeaked: Activity com.xty.activity.ActivityMainPage has leaked window
- WindowManager: android.view.WindowLeaked: Activity has leaked window com.android.internal.policy.imp
- android.view.WindowLeaked: Activity has leaked window com.android.internal.p
- E/WindowManager: android.view.WindowLeaked: Activity com.xxx.xxx.xxx has leaked window com.android.i
- android.view.WindowLeaked: Activity com.moreunion.zhenghao.ui.diary.DiaryDetailsActivity has leaked
- 窗体泄露 android.view.WindowLeaked: Activity XxxActivity has leaked window android.widget.PopupWindow$Po
- Android 报错android.view.WindowLeaked.....has leaked window com.android.internal.policy.
- android.view.WindowLeaked: Activity cn.com.zte.uc.activites.shipTicket.OrderWrite1 has leaked window
- android Activity has leaked window com.android.internal.policy.impl.PhoneWindow$Deco...
- com.com.adapterdialog.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$De
- android.view.WindowLeaked的解决办法 has leaked window android.widget.PopupWindow$PopupDecorView
- MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$
- android在学习——activity关闭和dialog.dismiss冲突的解决(Activity has leaked window com.android.internal.policy.impl.PhoneWindow)
- Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorVie
- WindowManager: android.view.WindowLeaked: Activity com.XXX.XXX.activity.XXXActivity has lea
- Activity has leaked window com.android.internal.policy.impl.PhoneWindow
- Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorVie
- [Android开发-异常]xxxActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView
- ERROR/WindowManager(***): Activity *** has leaked window com.android.internal.policy.impl.PhoneWind