Using Mediaplayer to play the audio file.
Everything works fine but the elapsed time of audio need to be updated in textview.
textview.setText(mediaplayer.getCurrentPosition()/100000.0).toString();
This gives the double value but if the end time is more than a minute and the elapsed time is 1minute it shows 0:60… but it should as 1:00…
Is there anyother way to show the elapsed time based on seekbar progress?
Thanks.
This works- Answer taken from another post :
How do I correctly display the position/duration of a MediaPlayer?
DateFormat works for dates, not for time intervals. So if you get a position of 1 second, the data format interprets this as meaning that the date/time is 1 second after the beginning the calendar.
And then do something like