Recently encountered such a problem:
E/windowmanager (30314): android.view.WindowLeaked:Activity com.xxxxxx.www.activity.XXXActivity has leaked window Com.android.internal.policy.impl.phonewindow$decorview{52b0f3ac v.e ..... R...... D 0,0-120,95} That is originally added here;
This is a form leaking exception, the general solution is to make the form (dialog or Popupwindow) dismiss () before Activity.finish (), the idea is correct, but not very comprehensive, Sometimes it will be found that even if your code inside the form is closed, the problem will still appear, today on the stack overflow found a more comprehensive answer here to share the first link to everyone http://stackoverflow.com/questions/ 2850573/activity-has-leaked-window-that-was-originally-added
Here are 3 answers for each of the three cases, the first one as above, the form closed after activity closed, the second case is actually the same as the first reason, but the reason why the activity is closed is not that we actively closed activity, Instead of catching the exception that caused the activity to close prematurely, and then when we go to invoke the form to show the occurrence of this exception, so the real need to solve is more than this form leak exception of the earlier exception (PS: This time I was down here, completely did not notice the error log of the earlier printing ... --! The third situation I haven't met has not been told.
This article only records the development of the experience spent more time is not easy to find the problem. Mark
Android Form Leak issue