Created
February 24, 2015 09:38
-
-
Save dominicthomas/a18d5d01f0b586fe41e6 to your computer and use it in GitHub Desktop.
Get a uri to an android resource..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Uri resourceToUri(final Context context, final int resID) { | |
return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + | |
context.getResources().getResourcePackageName(resID) + '/' + | |
context.getResources().getResourceTypeName(resID) + '/' + | |
context.getResources().getResourceEntryName(resID)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment