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?
Advertisement
Answer
Use getIdentifier()
int resourceId = this.getResources().getIdentifier("file_name", "raw", this.getPackageName());