From a593d9852f3807305763c3f1fe1ac5c59f1fef92 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 13 May 2011 14:09:54 -0700 Subject: [PATCH] Fix a bug where an action bar could be created when it should not be. Change-Id: I9ca1038accdb6d0a539750ed8ab068a41612f6ae --- core/java/android/app/Activity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index edfd6ef04473d..fc4d12ca57cad 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1760,6 +1760,11 @@ public class Activity extends ContextThemeWrapper */ private void initActionBar() { Window window = getWindow(); + + // Initializing the window decor can change window feature flags. + // Make sure that we have the correct set before performing the test below. + window.getDecorView(); + if (isChild() || !window.hasFeature(Window.FEATURE_ACTION_BAR) || mActionBar != null) { return; }