From 4cf1aefb45fcb7eb7395cdb59aaf462c43f60905 Mon Sep 17 00:00:00 2001 From: Ahbong Chang Date: Thu, 16 Aug 2012 14:04:40 +0800 Subject: Check if actionbar exists at ActionBarUtils.getActionBar(). Bug: 6927267 Change-Id: I85645f25879ced48a85a2bef4f55f1c34b8806ec --- src/com/android/gallery3d/actionbar/ActionBarUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/gallery3d/actionbar/ActionBarUtils.java b/src/com/android/gallery3d/actionbar/ActionBarUtils.java index 25ccb92b3..4df8d5c10 100644 --- a/src/com/android/gallery3d/actionbar/ActionBarUtils.java +++ b/src/com/android/gallery3d/actionbar/ActionBarUtils.java @@ -23,9 +23,12 @@ import com.android.gallery3d.common.ApiHelper; public class ActionBarUtils { public static ActionBarInterface getActionBar(Activity activity) { - return ApiHelper.HAS_ACTION_BAR - ? new SystemActionBarWrapper(activity) - : new SimpleActionBar(activity); + if (ApiHelper.HAS_ACTION_BAR) { + if (activity.getActionBar() == null) return null; + return new SystemActionBarWrapper(activity); + } else { + return new SimpleActionBar(activity); + } } public static ActionModeInterface startActionMode( -- cgit v1.2.3