CB-1358: Getting Force Close in incoming Cal while recording the Audio?

This commit is contained in:
Simon MacDonald 2012-08-31 12:45:01 -04:00
parent 1ba3ecbef3
commit 4d5e452ece

View File

@ -207,7 +207,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
* @param file The name of the audio file. * @param file The name of the audio file.
*/ */
public void startPlaying(String file) { public void startPlaying(String file) {
if (this.readyPlayer(file)) { if (this.readyPlayer(file) && this.player != null) {
this.player.start(); this.player.start();
this.setState(STATE.MEDIA_RUNNING); this.setState(STATE.MEDIA_RUNNING);
this.seekOnPrepared = 0; //insures this is always reset this.seekOnPrepared = 0; //insures this is always reset
@ -236,7 +236,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
public void pausePlaying() { public void pausePlaying() {
// If playing, then pause // If playing, then pause
if (this.state == STATE.MEDIA_RUNNING) { if (this.state == STATE.MEDIA_RUNNING && this.player != null) {
this.player.pause(); this.player.pause();
this.setState(STATE.MEDIA_PAUSED); this.setState(STATE.MEDIA_PAUSED);
} }