Exception scenarios:
It is often necessary to process time-consuming work in applications, such as reading large files and accessing network resources. To avoidProgramPoor user experience caused by false positives. Generally, we can use the thread + handler or Android-providedAsynctask to solve this problem, and usually uses ssdialog and other prompt controls to inform the user of the current program progress. The exceptions described in the title often appear in such scenarios, and often conceal the real culprit of exceptions.
Cause:
In the exception description, it means that a phonewindow cannot be destroyed in time due to window handle leakage. This tends to mislead us and focus too much on finding the so-called memory leakage. In fact, there is a serious exception caused by improper operations in some of our non-main threads, which forces the current activity to be closed. While disabling, dismiss cannot be called in time to cancelProgressdialog and so on, the system throws an error in the title, and masks the exception information that actually causes this error.
One solution:
This solution does not actually solve the problem, but can reveal the exception information that actually leads to errors to a certain extent. That is, override the ondestroy method of the activity and call dismiss in the method to cancelProgressdialog and so on.