OSDN Git Service

Check api level before invoking setHomeButtonEnabled().
authorAhbong Chang <cwahbong@google.com>
Tue, 31 Jul 2012 03:13:29 +0000 (11:13 +0800)
committerAhbong Chang <cwahbong@google.com>
Tue, 31 Jul 2012 06:48:36 +0000 (14:48 +0800)
Bug: 6706785
Change-Id: I2ad4d4961705c38a4d1047732f45dc9c69580782

src/com/android/gallery3d/app/GalleryActionBar.java

index 23e8f0b..2df6535 100644 (file)
@@ -230,7 +230,9 @@ public class GalleryActionBar implements ActionBar.OnNavigationListener {
 
     @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH)
     private void setHomeButtonEnabled(boolean enabled) {
-        mActionBar.setHomeButtonEnabled(enabled);
+        if (ApiHelper.HAS_ACTION_BAR_SET_HOME_BUTTON_ENABLED) {
+            mActionBar.setHomeButtonEnabled(enabled);
+        }
     }
 
     public void setDisplayOptions(boolean displayHomeAsUp, boolean showTitle) {