Skip to content

Instantly share code, notes, and snippets.

@misdake
Created July 24, 2013 02:50
Show Gist options
  • Save misdake/6067751 to your computer and use it in GitHub Desktop.
Save misdake/6067751 to your computer and use it in GitHub Desktop.
Android get resourceId from fileName
public static int getResourceId(Context context, String name) {
name = name.toLowerCase();
return context.getResources().getIdentifier(name, "drawable", context.getPackageName());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment