Merge "Only resize list popup if it's still attached to a window" into mnc-dev

This commit is contained in:
Alan Viverette
2015-05-07 20:07:47 +00:00
committed by Android (Google) Code Review

View File

@@ -1791,8 +1791,9 @@ public class ListPopupWindow {
private class ResizePopupRunnable implements Runnable {
public void run() {
if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount() &&
mDropDownList.getChildCount() <= mListItemExpandMaximum) {
if (mDropDownList != null && mDropDownList.isAttachedToWindow()
&& mDropDownList.getCount() > mDropDownList.getChildCount()
&& mDropDownList.getChildCount() <= mListItemExpandMaximum) {
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
show();
}