summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAhbong Chang <cwahbong@google.com>2012-08-16 14:04:40 +0800
committerAhbong Chang <cwahbong@google.com>2012-08-16 14:51:01 +0800
commit4cf1aefb45fcb7eb7395cdb59aaf462c43f60905 (patch)
treec9ee5bb61b182cff7adb67e9c42721624c68eb0c /src
parent5cede6dbbc322313d77595caf649f50bf34f593c (diff)
downloadandroid_packages_apps_Gallery2-4cf1aefb45fcb7eb7395cdb59aaf462c43f60905.tar.gz
android_packages_apps_Gallery2-4cf1aefb45fcb7eb7395cdb59aaf462c43f60905.tar.bz2
android_packages_apps_Gallery2-4cf1aefb45fcb7eb7395cdb59aaf462c43f60905.zip
Check if actionbar exists at ActionBarUtils.getActionBar().
Bug: 6927267 Change-Id: I85645f25879ced48a85a2bef4f55f1c34b8806ec
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/actionbar/ActionBarUtils.java9
1 files changed, 6 insertions, 3 deletions
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(