Why should I reject AlertDialog manually in Android?

Why should I call the reject () method for AlertDialog before the action is destroyed? Something is leaking, but what exactly? Why then can PopupWindow handle Activity destroying?

I found in Android sources that each warning dialog box creates a window:

Window w = PolicyManager.makeNewWindow(mContext);

What does it mean? Why can't he just use PhoneWindow derived from activity?

ADD

Say, links AlertDialog Context, context doesn’t reference anything, then GC must collect both objects (since they don’t refer to "outside"). What else has a link to AlertDialog? In other words, where is a memory leak?

+5
source share
1 answer

Alertdialogs id, This alertdialog, alertdialog, window (u set cancel false, ur ), . , AlertDialog. Thats y . , .

0

All Articles