Skip to content

Commit a587b89

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "ActivityChooser view not handling its removal and relayout properly." into jb-dev
2 parents df3633b + 748ee2e commit a587b89

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/java/android/widget/ActivityChooserView.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ protected void onDetachedFromWindow() {
400400
if (viewTreeObserver.isAlive()) {
401401
viewTreeObserver.removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
402402
}
403+
if (isShowingPopup()) {
404+
dismissPopup();
405+
}
403406
mIsAttachedToWindow = false;
404407
}
405408

@@ -420,9 +423,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
420423
@Override
421424
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
422425
mActivityChooserContent.layout(0, 0, right - left, bottom - top);
423-
if (getListPopupWindow().isShowing()) {
424-
showPopupUnchecked(mAdapter.getMaxActivityCount());
425-
} else {
426+
if (!isShowingPopup()) {
426427
dismissPopup();
427428
}
428429
}

0 commit comments

Comments
 (0)