OSDN Git Service

Fix UnsupportedOperationException in MediaObject
authorDoris Liu <tianliu@google.com>
Mon, 12 Nov 2012 23:17:36 +0000 (15:17 -0800)
committerDoris Liu <tianliu@google.com>
Mon, 12 Nov 2012 23:57:21 +0000 (15:57 -0800)
Bug: 6495745
Change-Id: I770833f0c3fec6f187e961f511a7d9d2591f5f97

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

index da5465b..492cdfb 100644 (file)
@@ -1024,11 +1024,16 @@ public abstract class PhotoPage extends ActivityState implements
         refreshHidingMessage();
         MediaItem current = mModel.getMediaItem(0);
 
         refreshHidingMessage();
         MediaItem current = mModel.getMediaItem(0);
 
+        // This is a shield for monkey when it clicks the action bar
+        // menu when transitioning from filmstrip to camera
+        if (current instanceof SnailItem) return true;
+        // TODO: We should check the current photo against the MediaItem
+        // that the menu was initially created for. We need to fix this
+        // after PhotoPage being refactored.
         if (current == null) {
             // item is not ready, ignore
             return true;
         }
         if (current == null) {
             // item is not ready, ignore
             return true;
         }
-
         int currentIndex = mModel.getCurrentIndex();
         Path path = current.getPath();
 
         int currentIndex = mModel.getCurrentIndex();
         Path path = current.getPath();