Lines Matching defs:uri
32 import android.net.Uri;
108 // It's not an integer, use it as a URI
109 Uri uri = Uri.parse(drawableId);
110 if (ContentResolver.SCHEME_ANDROID_RESOURCE.equals(uri.getScheme())) {
112 drawable = new Now<Drawable>(getDrawable(uri));
114 drawable = new IconLaterTask(uri);
124 public Uri getIconUri(String drawableId) {
133 return Uri.parse(drawableId);
138 * Gets a drawable by URI.
142 private Drawable getDrawable(Uri uri) {
144 String scheme = uri.getScheme();
147 OpenResourceIdResult r = getResourceId(uri);
151 throw new FileNotFoundException("Resource does not exist: " + uri);
155 InputStream stream = mPackageContext.getContentResolver().openInputStream(uri);
157 throw new FileNotFoundException("Failed to open " + uri);
165 Log.e(TAG, "Error closing icon stream for " + uri, ex);
170 Log.w(TAG, "Icon not found: " + uri + ", " + fnfe.getMessage());
184 * Resolves an android.resource URI to a {@link Resources} and a resource id.
186 private OpenResourceIdResult getResourceId(Uri uri) throws FileNotFoundException {
187 String authority = uri.getAuthority();
190 throw new FileNotFoundException("No authority: " + uri);
198 List<String> path = uri.getPathSegments();
200 throw new FileNotFoundException("No path: " + uri);
208 throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
213 throw new FileNotFoundException("More than two path segments: " + uri);
216 throw new FileNotFoundException("No resource found for: " + uri);
225 private final Uri mUri;
227 public IconLaterTask(Uri iconUri) {