Reputation: 165
I want to get the full address by the name of the file. For example:
Input young_volcanos
- String name
Output R.raw.young_volcanos
- int path
Is it possible?
Upvotes: 0
Views: 111
Reputation: 1278
Use getIdentifier()
int resourceId = this.getResources().getIdentifier("file_name", "raw", this.getPackageName());
Upvotes: 1