Guys and Gals - So I basically have the android GridView example and
on click I am trying to play one sound file then follow it up with
another. I get static when the 2nd file starts to play. Am I missing
something? Do I need to have a more elaborate buffering set up or
something? Thanks for any pointers or help. Will
public class HelloGridView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int
position, long id) {
Toast.makeText(HelloGridView.this, "" + position,
Toast.LENGTH_SHORT).show();
MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.a);
mp.start();
mp.setOnCompletionListener(new OnCompletionListener(){
public void onCompletion(MediaPlayer arg0){
MediaPlayer mp2 =
MediaPlayer.create(getApplicationContext(),R.raw.apple);
mp2.start();
}
});
}
});
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en