From 35c3cb6a598d2868db064a2dcd6f3b7031fe9f0a Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 30 Oct 2014 13:51:21 -0700 Subject: Remove scroll view from correct parent in AlertController BUG: 18191700 Change-Id: I37602fc26d103b76021f00c58f03bc32d7a978fe --- core/java/com/android/internal/app/AlertController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/java/com') diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index 3630cc7..35e03c3 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -37,6 +37,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; +import android.view.ViewParent; import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowInsets; @@ -589,9 +590,10 @@ public class AlertController { mScrollView.removeView(mMessageView); if (mListView != null) { - final int childIndex = mScrollView.indexOfChild(mScrollView); - contentPanel.removeViewAt(childIndex); - contentPanel.addView(mListView, childIndex, + final ViewGroup scrollParent = (ViewGroup) mScrollView.getParent(); + final int childIndex = scrollParent.indexOfChild(mScrollView); + scrollParent.removeViewAt(childIndex); + scrollParent.addView(mListView, childIndex, new LayoutParams(MATCH_PARENT, MATCH_PARENT)); } else { contentPanel.setVisibility(View.GONE); -- cgit v1.1