Skip to content

Instantly share code, notes, and snippets.

@brandhill
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandhill/c899222c25b9f4ece755 to your computer and use it in GitHub Desktop.
Save brandhill/c899222c25b9f4ece755 to your computer and use it in GitHub Desktop.
android : get an uri of an image resource
public static final String ANDROID_RESOURCE = "android.resource://";
public static final String FORESLASH = "/";
public static Uri resIdToUri(Context context, int resId) {
return Uri.parse(Consts.ANDROID_RESOURCE + context.getPackageName()
+ Consts.FORESLASH + resId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment