title: android - videoView.setOnCompletionListener called twice
body: <p>I am playing a video in videoview. On its completion I have to start a CountdownTimer. The method setOnCompletionListener of videoview is called twice and hence the code to start the timer runs twice.</p>
  
  <p>Do I need to call any other method to do the task?</p>
  
  <p>Code: </p>
  
  <pre><code>VideoView videoView;
  private MediaController controller;
  
   private void setupView(View view){
  videoView = (VideoView) view.findViewById(R.id.videoView);
  controller = new MediaController(getActivity());
  controller.setAnchorView(videoView);
  
  
  videoView.setMediaController(null);
      videoView.setOnTouchListener(new OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              return true;
          }
      });
      videoView.setOnCompletionListener(new OnCompletionListener() {
          @Override
          public void onCompletion(MediaPlayer mp) {
              stopVideoViewTimer();
              startExcerciseDetailTimer();
          }
      });
  playCurrentVideo();
  }
  private void playCurrentVideo() {
  
  if (prepareVideo()) {
              roundTimeLayoutCombos.setVisibility(View.GONE);
              excerciseTimerLayout.setVisibility(View.GONE);
              restTimeLayout.setVisibility(View.GONE);
              videoLayout.setVisibility(View.VISIBLE);
                      updateExerciseLayout();
                  videoView.start();
          }
  }
  
  private Boolean prepareVideo() {
      Boolean prepared = false;
          String filePath = Environment.getExternalStorageDirectory()+"/folder/xyz.mp4";
          videoView.setVideoURI(Uri.parse(filePath));
          videoView.requestFocus();
          prepared = true;
  
      return prepared;
  }
  </code></pre>