In javascript, we can conditionally select a value from a object using a variable as,
var myObj = {"a": "Val1", "b": "Val2", "c": "Val3"};
var key = "a";
var val = myObj[key];
What is the similar method to select the value from a string resource file in android using variable string name?
We can select a string as R.string.mystring in android and from a java public class
public class myarray {
public static final String test = "Test";
public myarray(){
}
}
as String val = myarray.test; but we wanted a method something similar to above javascript.