lorensiuswlt/NewQuickAction — Issue #4: 'activity has leaked window' exception on change orientation
Author: ardock
Created: 2011-10-25 02:40:19+00:00
State: open

Hi Lorensius,

Android recreates de view on change orientation but dont manage it for us.

If you open de quickaction and changes orientation, you ll see an 'activity leaked a window' exception.

Log:
10-25 04:30:47.686: E/WindowManager(221): Activity test has leaked window android.widget.PopupWindow$PopupViewContainer@44e0ab60 that was originally added here
10-25 04:30:47.686: E/WindowManager(221): android.view.WindowLeaked: Activity test has leaked window android.widget.PopupWindow$PopupViewContainer@44e0ab60 that was originally added here
10-25 04:30:47.686: E/WindowManager(221):	at android.view.ViewRoot.(ViewRoot.java:227)
10-25 04:30:47.686: E/WindowManager(221):	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
10-25 04:30:47.686: E/WindowManager(221):	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
10-25 04:30:47.686: E/WindowManager(221):	at android.view.Window$LocalWindowManager.addView(Window.java:424)

A possible solution, dismiss the quickaction:
Mark Murphy said "Move that logic out of the the View and into the Activity. Then, dismiss
them in whichever of onPause/onStop/onDestroy fits your needs best. Save a
flag or something in onSaveInstanceState() to let you know to re-open them
after the orientation change."
http://comments.gmane.org/gmane.comp.handhelds.android.devel/60167