I am trying to play a file using the MediaPlay. The first time it is played, it only plays for 1 or 2 seconds then cuts out and never returns. The second time I play the song, it goes about 3 seconds. This function is in the onCreate function:
checkin.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked){
MediaPlayer mp = MediaPlayer.create(context, R.raw.my_song);
mp.start();
v.vibrate(500);
myLocation.getLocation(context, locationResult);
}
Is another thread clearing overriding the song? How do I get my whole song to play?