Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Error while playing Media player within IF statement

I'm trying to play a specific sound when the countdowntimer reaches 9 seconds tell 0, but the sound quality is very bad and lagging and I get this error E/MediaPlayer: Error (1,-19)

public void updateTime(int secondsleft){



    int minutes = (int) secondsleft / 60;
    mseconds = secondsleft  - minutes * 60;
    String seconds = Integer.toString(mseconds);


    if (mseconds <= 9){

        seconds = "0" + seconds;


    }

    if (mseconds <= 10){

        actionTextView.setText(Integer.toString(mseconds));


    }

    timerTextView.setText(Integer.toString(minutes)+":"+seconds);


}

Comments