import com.android.gallery3d.common.Utils;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaDetails;
+import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.data.MediaObject;
import com.android.gallery3d.data.MediaSet;
import com.android.gallery3d.data.Path;
import com.android.gallery3d.util.HelpUtils;
import java.lang.ref.WeakReference;
+import java.util.ArrayList;
public class AlbumSetPage extends ActivityState implements
SelectionManager.SelectionListener, GalleryActionBar.ClusterRunner,
private static boolean albumShouldOpenInFilmstrip(MediaSet album) {
int itemCount = album.getMediaItemCount();
- return (album.isCameraRoll() && itemCount > 0) || itemCount == 1;
+ ArrayList<MediaItem> list = (itemCount == 1) ? album.getMediaItem(0, 1) : null;
+ return (album.isCameraRoll() && itemCount > 0)
+ // open in film strip only if there's one item in the album and the item exists
+ || (list != null && !list.isEmpty());
}
WeakReference<Toast> mEmptyAlbumToast = null;