android - MediaPlayer setOnPreparedListener doesn't get called for second time -
i using listview adapter displays list of tracks.each list item has play , stop icons play , stop track.the issue having track gets played once when first click on play button.after if stop clicking on stop button , try play track doesn't played.through toast message found out holder.img1.setonclicklistener() method called onprepared() method doesn't called on clicking on play button second time or after that..if replace mmediaplayer.pause();
mmediaplayer.release();
still same result..if put mmediaplayer=new mediaplayer();
inside onclick() method of holder.img1.setonclicklistener
above issue resolved clicking on multiple play buttons start playing multiple tracks @ same time don't want..
trying going nightmare due naming conventions , lack of commenting. recommend change naming convention people looking @ code have idea each of variables doing. small comments on can helpful when in understanding trying do.
Comments
Post a Comment