OSDN Git Service

Allow for extension for pano-based navigation.
authorGeorge Mount <mount@google.com>
Mon, 19 Aug 2013 21:36:06 +0000 (14:36 -0700)
committerGeorge Mount <mount@google.com>
Mon, 19 Aug 2013 21:43:05 +0000 (14:43 -0700)
Bug 9265629

Change-Id: Ief895285991b2200a423636580a68f1d21a31cdf

src/com/android/gallery3d/filtershow/crop/CropActivity.java

index 0a0c367..3a78296 100644 (file)
@@ -106,17 +106,18 @@ public class CropActivity extends Activity {
         mCropView = (CropView) findViewById(R.id.cropView);
 
         ActionBar actionBar = getActionBar();
-        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
-        actionBar.setCustomView(R.layout.filtershow_actionbar);
-
-        View mSaveButton = actionBar.getCustomView();
-        mSaveButton.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                startFinishOutput();
-            }
-        });
-
+        if (actionBar != null) {
+            actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+            actionBar.setCustomView(R.layout.filtershow_actionbar);
+
+            View mSaveButton = actionBar.getCustomView();
+            mSaveButton.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    startFinishOutput();
+                }
+            });
+        }
         if (intent.getData() != null) {
             mSourceUri = intent.getData();
             startLoadBitmap(mSourceUri);
@@ -275,7 +276,7 @@ public class CropActivity extends Activity {
         }
     }
 
-    private void startFinishOutput() {
+    protected void startFinishOutput() {
         if (finalIOGuard) {
             return;
         } else {