<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer-array name="myArray">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</integer-array>
</resources>
and basically I want to play a different sound randomly based on an onClick or onShake event...I having the Listeners setup and working and I'm using MediaPlayer mp.start() to play them successfully (which seems it will only take one int at a time...The problem is
1. I'm having a bit of trouble converting the whole array to be specified by one string such as:
String soundArrayString = getArray(R.array.myArray); (I know this will not work, just trying to paint a picture
)2. Getting one of the items from the array randomly as the randomocity is continuously cycling through (if necessary)...
3. Using that randomly called item in the array to play the corresponding sound (String to int technique I just can't seem to understand)
Here's my code so far without any random or array codes (I've tried a lot and nothing is working):
ImageButton testbutton = (ImageButton)findViewById(R.id.button1);
testbutton.setOnClickListener(new OnClickListener() {
MediaPlayer mp = MediaPlayer.create(Project1.this,
R.raw.sound1);
public void onClick(View v) {
mp.seekTo(0);
mp.start();
Does this even seem like I'm heading the right direction for what I'm trying to accomplish?

