diff --git a/library/src/main/java/com/bumptech/glide/load/model/ResourceLoader.java b/library/src/main/java/com/bumptech/glide/load/model/ResourceLoader.java index 1175315a84..ad48104ba6 100644 --- a/library/src/main/java/com/bumptech/glide/load/model/ResourceLoader.java +++ b/library/src/main/java/com/bumptech/glide/load/model/ResourceLoader.java @@ -52,9 +52,7 @@ private Uri getResourceUri(Integer model) { + "://" + resources.getResourcePackageName(model) + '/' - + resources.getResourceTypeName(model) - + '/' - + resources.getResourceEntryName(model)); + + model); } catch (Resources.NotFoundException e) { if (Log.isLoggable(TAG, Log.WARN)) { Log.w(TAG, "Received invalid resource id: " + model, e); diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java index 1bda30e238..708dba9d2f 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java @@ -49,7 +49,7 @@ public void setUp() { @Test public void testCanHandleId() { int id = android.R.drawable.star_off; - Uri contentUri = Uri.parse("android.resource://android/drawable/star_off"); + Uri contentUri = Uri.parse("android.resource://android/" + String.valueOf(id)); when(uriLoader.buildLoadData(eq(contentUri), anyInt(), anyInt(), any(Options.class))) .thenReturn(new ModelLoader.LoadData<>(key, fetcher));