am a587b890: Merge "ActivityChooser view not handling its removal and relayout properly." into jb-dev

* commit 'a587b890bb0c2f800fe4dfd3267f26366d00d32c':
  ActivityChooser view not handling its removal and relayout properly.
This commit is contained in:
Svetoslav Ganov
2012-05-23 16:08:49 -07:00
committed by Android Git Automerger

View File

@@ -400,6 +400,9 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
if (viewTreeObserver.isAlive()) {
viewTreeObserver.removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
}
if (isShowingPopup()) {
dismissPopup();
}
mIsAttachedToWindow = false;
}
@@ -420,9 +423,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
mActivityChooserContent.layout(0, 0, right - left, bottom - top);
if (getListPopupWindow().isShowing()) {
showPopupUnchecked(mAdapter.getMaxActivityCount());
} else {
if (!isShowingPopup()) {
dismissPopup();
}
}