Convert an int-value to a resource uri

view full story

http://stackoverflow.com – i have implemented an android-project which plays a random song. So i have an int-array like this: int [] playlist_stadt = {R.raw.black_a, R.raw.black_b, R.raw.black_c}; for the random play i wrote: Random r = new Random(); int i = playlist_stadt[r.nextInt(playlist_stadt.length)]; PlayMusic(i); what i dont understand is following: textView.setText(i); textview shows: res/raw/black_c.mp3 Log.e("Output: ", "" + i); String uriPath = "android.resource://" + getPackageName() + i; in the log is i an number and not the same string how in the textview: Output: 2130968577 203-06 13: (HowTos)