From ccf8e661c7aa750865c33ddc3ddfecd8775f3ae7 Mon Sep 17 00:00:00 2001 From: Chris Banes Date: Wed, 23 Mar 2016 16:20:00 +0000 Subject: [PATCH] Allow AlertDialog to be used in a DialogFragment AlertController calls requestWindowFeature() too later for DialogFragment. Fixed by moving it to the constructor. BUG: 27809055 Change-Id: Icef01316b4e857b41ccc29cc56bbcecd7f629342 --- core/java/com/android/internal/app/AlertController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index aac7bc3810e9a..753c0691222e0 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -204,6 +204,9 @@ public class AlertController { mShowTitle = a.getBoolean(R.styleable.AlertDialog_showTitle, true); a.recycle(); + + /* We use a custom title so never request a window title */ + window.requestFeature(Window.FEATURE_NO_TITLE); } static boolean canTextInput(View v) { @@ -229,8 +232,6 @@ public class AlertController { } public void installContent() { - /* We use a custom title so never request a window title */ - mWindow.requestFeature(Window.FEATURE_NO_TITLE); int contentView = selectContentView(); mWindow.setContentView(contentView); setupView();