Created
June 16, 2013 08:16
-
-
Save pbrewczynski/5791357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void playDing(int howManyTimes) { | |
if(howManyTimes >0){ | |
MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.dingshort); | |
mPlayer.setOnCompletionListener(new OnCompletionListener() { | |
@Override | |
public void onCompletion(MediaPlayer mp) { | |
playDing(howManyTimes-1); //But java don't support closures | |
} | |
}); | |
mPlayer.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment