private final int NUM_SOUND_FILES = 4;
private Random rnd = new Random(4);
private int mfile[] = new mfile[NUM_SOUND_FILES]; //the second mfile
//reports error everytime
mfile[0] = R.raw.sound1;
mfile[1] = R.raw.sound2;
mfile[2] = R.raw.sound3;
mfile[3] = R.raw.sound4;
int sndToPlay = rnd.nextInt(NUM_SOUND_FILES);
I keep getting syntax errors no matter how I write it. And when I get the syntax right, it forcecloses. Here's with the alleged "correct" syntax but forcecloses:
private final int NUM_SOUND_FILES = 4;
private Random rnd = new Random(4);
private int mfile[] = new int[NUM_SOUND_FILES];{
mfile[0] = R.raw.sound1;
mfile[1] = R.raw.sound2;
mfile[2] = R.raw.sound3;
mfile[3] = R.raw.sound4;}