I have a MediaPlayer and an audio file, which I need to play, also I have an ArrayList with the certain seconds of this audio file, on this seconds while audio is playing, I need to switch pages in the ViewPager. How to get a CallBack from the MediaPlayer in these certain moments of the time? or maybe you will recommend some other way how is possible to do it. 

What I have right now is the method, where I use CountDownTimer, which change pages in ViewPager, but it works wrong and it doesn't take into the account fact that an audio track can be stop and then resume.

```
 public void startPlayingLabels() {

        mPlayer = new MediaPlayer();

        try {
            String mFileName = CameraFragment.mAudioFolder + "/" + ViewActivity.parentName + ".3gp";
            mPlayer.setDataSource(mFileName);
            mPlayer.prepare();
            mPlayer.start();

            for (int i=0; i<zeroLabelPosition.size()-1; i++) {

                final int finalI = i;
                new CountDownTimer(Integer.parseInt(String.valueOf(Integer.parseInt((String) zeroTime.get(finalI + 1)) - Integer.parseInt((String) zeroTime.get(finalI)))), 1000) {
                    public void onTick(long millisUntilFinished) {
                    }

                    public void onFinish() {
                        mPager.setCurrentItem(Integer.parseInt(String.valueOf(zeroLabelPosition.get(finalI))));
                    }
                }.start();
            }
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }

```