/** Displays the "Resuming from xx:xx" toast. */ public void displayAudiobookToast(long resumePlaybackPosition) { try { String resumingFrom = mContext.getResources().getString(R.string.resuming_from) + " " + mApp.convertMillisToMinsSecs(resumePlaybackPosition) + "."; Toast.makeText(mContext, resumingFrom, Toast.LENGTH_LONG).show(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void onProgressChanged(SeekBar seekBar, int seekBarPosition, boolean changedByUser) { try { long currentSongDuration = mApp.getService().getCurrentMediaPlayer().getDuration(); seekBar.setMax((int) currentSongDuration / 1000); if (changedByUser) mSeekbarIndicatorText.setText( mApp.convertMillisToMinsSecs(seekBar.getProgress() * 1000)); } catch (Exception e) { e.printStackTrace(); } }