diff options
author | Ahbong Chang <cwahbong@google.com> | 2012-08-16 14:04:40 +0800 |
---|---|---|
committer | Ahbong Chang <cwahbong@google.com> | 2012-08-16 14:51:01 +0800 |
commit | ad2d3108ead2b057fb7ece3984bc7252268afabf (patch) | |
tree | 3d6d7cc34f00533fe333ec9ab19e1819b0567759 /src | |
parent | a987b12c396ef9b0482c4ca827131db125bf8ef8 (diff) | |
download | android_packages_apps_Snap-ad2d3108ead2b057fb7ece3984bc7252268afabf.tar.gz android_packages_apps_Snap-ad2d3108ead2b057fb7ece3984bc7252268afabf.tar.bz2 android_packages_apps_Snap-ad2d3108ead2b057fb7ece3984bc7252268afabf.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.java | 9 |
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( |