When I use dismiss to remove a popup window, does it only hide it or removes it from memory?
I tried dismiss, then showAtLocation several times (using the same PopupWindw object, not re-creating it) and the window was displayed and hidden without problems. The question is can I count on it – perhaps it is marked for deletion by the GC, but hasn’t been garbage-collected yet?
Thanks.
dismiss()is opposite toshowAtLocation(), the object remains in a valid state afterdismiss(). So it is safe to toggledismiss()/showAtLocation()It can be seen from the Android source code in here – you can look at
dismiss()andshowAtLocation()implementationshttp://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/PopupWindow.java#PopupWindow.showAtLocation%28android.view.View%2Cint%2Cint%2Cint%29
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/PopupWindow.java#PopupWindow.dismiss%28%29