Android 泄露窗口?
我有一个错误,说
Activity com.my.app 泄漏了最初在此处添加的窗口 com.android.internal.policy.impl.PhoneWindow$DecorView@46010128
我看到许多其他答案说我需要在完成之前关闭对话框,但是当我的应用程序仍在运行时就会发生错误。我所做的是创建一个对话框,然后在不同的线程上运行进程。在线程结束时,我向处理程序发送一条消息以关闭对话框。运行时,我会看到该对话框一秒钟,然后应用程序强制关闭。到底是怎么回事?
I have an error saying that
Activity com.my.app has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46010128 that was originally added here
I saw many other answers saying that I need to dismiss the dialog before finishing, but the error occurs when my app is still running. What I do is create a dialog, then run process on a different thread. At the end of the thread I send a message to a handler to close the dialog. When running, I see the dialog for a second, then the app force closes. What is going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在从 onDestroy() 返回之前,您需要关闭所有已创建的窗口。
您还没有提供导致应用程序崩溃的异常的堆栈爬网,因此没有人致电帮助您解决此问题。
You need to close all windows you have created before returning from onDestroy().
You haven't given the stack crawl of the exception causing your app to crash so nobody call help you with that.