1. Download our Official Android App: Forums for Android!

Apps mediaplayer interruptted in repeat

Discussion in 'Android Development' started by desatir7316, Jan 7, 2015.

  1. desatir7316

    desatir7316 Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    35
    Joined:
    Dec 25, 2014

    Dec 25, 2014
    35
    2
    16
    Male
    hi there
    on MotionEvent.ACTION_MOVE i want to play a shot sound repeatedly
    but after a moment it will be silent and i solved it by followwing code:
    Code (Text):
    1.  
    2.  mPlayer = MediaPlayer.create(this, R.raw.tirbar8);
    3.  mPlayer.start();
    4. mPlayer.setOnCompletionListener(new OnCompletionListener() {
    5.                 public void onCompletion(MediaPlayer mp) {
    6.                     mp.release();
    7.                 }
    8.             });
    9.  
    10.  
    now i have a interrupt in my sound
    how to solve it?
     

    Advertisement

Share This Page

Loading...