活动已泄漏的窗口? [英] Activity has leaked window?

查看:120
本文介绍了活动已泄漏的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java类,一旦有人购买我们的应用程序,然后它会开始下载和进度对话框中有出现,而不是它使用了一些其他的网页,当我出来的应用程序,当我重新启动再它开始下载。 请帮我从这个烂摊子......

I am having one java class in that class as soon some one purchases our application then it will start downloading and progress dialog has to appear instead it goes to some other page and when i come out of the application and when i restart then it starts downloading. Please Help me out from this mess...

感谢您

推荐答案

两个原因你的错误发生了:

Two causes for your error happen:

  1. 该错误会发生什么,如果你想显示对话框您已经退出了活动<后/ code>。

  1. The error will happen if you're trying to show a Dialog after you've exited an Activity.

另外,如果未处理的异常被扔在你的的AsyncTask ,这将导致活动来关机,然后打开的进度对话框将会导致异常

Also, if an unhandled Exception was thrown in your AsyncTask, which would cause the Activity to shutdown, then an open progress dialog will cause the Exception.

根据您发布,之后您调用错误发生在日志 pDialog.show()这可能是我之前所提到的第一个原因。

According to the Log you've posted, the error happens after you call pDialog.show() which might be the 1st cause I've mentioned before.

另外你调用完成()在你的code很多地方,也许这些要求之一是使你的活动停止并泄露你的对话框

Also you are calling finish() in many parts of your code, maybe one of these calls are making your Activity to stop and leaking your Dialog.

您必须检查哪一个是整理你的活动您展示对话框之前。一个好的解决方法是关闭该对话框(如果它显示)之前调用完成()

You must check which one of them is finishing your Activity before you show the Dialog. A good solution is to dismiss the Dialog (if it's showing) before calling finish().

这篇关于活动已泄漏的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆