Last active
August 29, 2015 14:04
-
-
Save brandhill/c899222c25b9f4ece755 to your computer and use it in GitHub Desktop.
android : get an uri of an image resource
This file contains 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 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