code: Drawable getDrawableFromResourceUri(Uri uri) throws FileNotFoundException {
          String authority = uri.getAuthority();
          Resources r;
          if (TextUtils.isEmpty(authority)) {
              throw new FileNotFoundException("No authority: " + uri);
          } else {
              try {
                  r = mContext.getPackageManager().getResourcesForApplication(authority);
              } catch (NameNotFoundException ex) {
                  throw new FileNotFoundException("No package found for authority: " + uri);
              }
          }
          List<String> path = uri.getPathSegments();
          if (path == null) {
              throw new FileNotFoundException("No path: " + uri);
          }
          int len = path.size();
          int id;
          if (len == 1) {
              try {
                  id = Integer.parseInt(path.get(0));
              } catch (NumberFormatException e) {
                  throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
              }
          } else if (len == 2) {
              id = r.getIdentifier(path.get(1), path.get(0), authority);
          } else {
              throw new FileNotFoundException("More than two path segments: " + uri);
          }
          if (id == 0) {
              throw new FileNotFoundException("No resource found for: " + uri);
          }
          return r.getDrawable(id);
      }
docs: Import of hidden method: ContentResolver.getResourceId(Uri).
  Modified to return a drawable, rather than a hidden type.