Fix bug 3198503 - NPE at MenuPopupHelper.dismiss
Make sure dismiss() can be called even when the popup is not currently showing. Change-Id: I48077d8b3bfe0df04bceeb056ed54cbd79a6e660
This commit is contained in:
@@ -110,8 +110,10 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
|
||||
if (isShowing()) {
|
||||
mPopup.dismiss();
|
||||
}
|
||||
mTreeObserver.removeGlobalOnLayoutListener(this);
|
||||
mTreeObserver = null;
|
||||
if (mTreeObserver != null) {
|
||||
mTreeObserver.removeGlobalOnLayoutListener(this);
|
||||
mTreeObserver = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
|
||||
Reference in New Issue
Block a user