Pausing and resuming a runnable thread in an activity

I am making a app for training. In my app one video is playing after some second one alert dialog show the dialog contain question and answer student read the question and select the answer until my thread want to wait. Here i successfully get the video timing. I want to do pause the thread until alert dialog close.

                mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                    public void onPrepared(MediaPlayer mp) {
                        running = true;
                        final int duration = mVideoView.getDuration();

                        new Thread(new Runnable() {
                            boolean myRunning;

                            public void run() {
                                synchronized (mSync) {
                                    myRunning = mSync.running;
                                }
                                do {
                                    textView.post(new Runnable() {
                                        public void run() {
                                            int time = Math.round(mVideoView.getCurrentPosition() / 1000);
                                            textView.setText(time + "");
                                            if (time == 5) {
                                                running = false;
                                                mVideoView.pause();
                                                AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Page02.this);
                                                alertDialogBuilder.setMessage("Are you sure,You wanted to make decision");
                                                alertDialogBuilder.setPositiveButton("yes",
                                                        new DialogInterface.OnClickListener() {
                                                            @Override
                                                            public void onClick(DialogInterface arg0, int arg1) {
                                                                onResume();
                                                                mVideoView.start();
                                                                arg0.dismiss();
                                                            }
                                                        });

                                                alertDialogBuilder.setNegativeButton("No", new DialogInterface.OnClickListener() {
                                                    @Override
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        finish();
                                                    }
                                                });
                                                AlertDialog alertDialog = alertDialogBuilder.create();
                                                alertDialog.show();
                                            }
                                        }
                                    });
                                    try {
                                        Thread.sleep(500);
                                    } catch (InterruptedException e) {
                                        e.printStackTrace();
                                    }
                                    if (!running) break;
                                }
                                while (mVideoView.getCurrentPosition() < duration);
                            }
                        }).start();
                    }
                });
            }

            @Override
            protected void onPause() {
                super.onPause();
                synchronized (mSync) {
                    running = false;// you can not set it here because
                    // it is possible for the thread to read it and exit the loop before he posts your message
                    mSync.mustBePost = true;
                    mSync.message = "Main Activity is going to pause";
                }
            }

            @Override
            protected void onResume() {
                super.onResume();
                threadNameCounter++;
                synchronized (mSync) {
                    running = true;
                    mSync.mustBePost = true;
                    mSync.message = "Main Activity is going to resume";
                }
                t = new Thread("My Name is " + String.valueOf(threadNameCounter));
                t.start();
            }
        }