See code below...
public static final int s1 = R.raw.s_1slow1;
public static final int s2 = R.raw.s_2fast6;
public static final int s3 = R.raw.s_3slow4;
String trackName = "s" + selectedTrack; //selectedTrack is an integer(1-3)
mPlayer = MediaPlayer.create(getApplicationContext(),
this.getClass().getField(trackName).getName()); //failed attempt
Is there a way to get the resource ID, based on a string?
For example I would need the value of "R.raw.s_1slow1".