I have seen several threads about this question but I don’t know why they are not working for me. Here the short code:
//This doesn't work. I'm getting a 0 id
id=getResources().getIdentifier("q1", "id", getPackageName());
//This retrieves the string correctly (just to prove the string is called q1
String str=getResources().getString(R.string.q1);
The only thing I could think about is a problem with the packagename, but it seems Ok.
Any help?
Get Resource By Name