Guest User

Untitled

a guest
Sep 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. mediaplayer gets hanged
  2. public void onClick(View v)
  3.  
  4. {
  5. if(count==listlen)
  6. count=-1;
  7. if(count<listlen)
  8. {
  9. count=count+1;
  10. }
  11. loadpitch(concatstr);
  12. }
  13.  
  14. try
  15. {
  16. if(sp.isChecked()||sm.isChecked())
  17. {
  18.  
  19. mp.reset();
  20. mp=MediaPlayer.create(this,resID);
  21. mp.setLooping(true);
  22. }
  23. if(play==true)
  24. {
  25. mp.start();
  26. }
  27. }
  28.  
  29. if (mPlayer!=null) {
  30. mPlayer.stop();
  31. mPlayer.release();
  32. }
  33. mPlayer= MediaPlayer.create(YourActivity.this,song);
  34. mPlayer.start();
Add Comment
Please, Sign In to add comment