How to call R.raw.sound Array from strings.xml?

261 Views Asked by At

I want to call this list of raw file from strings.xml

int[] sound = {

    R.raw.sound1,
    R.raw.sound2,
    R.raw.sound3,
    R.raw.sound4,
    R.raw.sound5,
};

How to type in a strings.xml and call from code ?

1

There are 1 best solutions below

0
On

raw folder sound in add to strings.xml file array

strings.xml

<string-array name="select_sounds">
     <item>@raw/sound1</item>
     <item>@raw/sound2</item>
     <item>@raw/sound3</item>
     <item>@raw/sound4</item>
     <item>@raw/sound5</item>
 </string-array>