OSDN Git Service

AlbumDataLoader.get returns correct value if not in cache
authorBobby Georgescu <georgescu@google.com>
Tue, 27 Nov 2012 19:21:51 +0000 (11:21 -0800)
committerBobby Georgescu <georgescu@google.com>
Tue, 27 Nov 2012 19:53:42 +0000 (11:53 -0800)
Bug: 7621656
Change-Id: I8b73837f41bf4ac8c753a5d84f251219fde8ae75

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

index 0ee1b03..28a8228 100644 (file)
@@ -120,8 +120,7 @@ public class AlbumDataLoader {
 
     public MediaItem get(int index) {
         if (!isActive(index)) {
-            throw new IllegalArgumentException(String.format(
-                    "%s not in (%s, %s)", index, mActiveStart, mActiveEnd));
+            return mSource.getMediaItem(index, 1).get(0);
         }
         return mData[index % mData.length];
     }