Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public void tocarSino(final int repeticao, final long intervalo,final int audio, final Context ctx){
  2. Thread timerSound = new Thread(){
  3. public void run(){
  4. try {
  5. for (int i=1; i<=repeticao; i++) {
  6. MediaPlayer mediaPlayer = MediaPlayer.create(ctx, audio);
  7. mediaPlayer.start();
  8. sleep(intervalo);
  9. }
  10. } catch (InterruptedException e) {
  11. e.printStackTrace();
  12. }
  13. }
  14. };
  15. timerSound.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement