Code example for MediaPlayer.OnCompletionListener

Methods: onCompletion

0
 
	private MediaPlayer.OnCompletionListener mCompletionListener = new MediaPlayer.OnCompletionListener() {
		 
		public void onCompletion(MediaPlayer mp) { 
			if (mOnCompletionListener != null) { 
				mOnCompletionListener.onCompletion(mMediaPlayer); 
			} 
			mp.seekTo(0); 
			mp.start(); 
		} 
	}; 
 
	private MediaPlayer.OnErrorListener mErrorListener = new MediaPlayer.OnErrorListener() {
	 
		public boolean onError(MediaPlayer mp, int framework_err, int impl_err) { 
			if (mOnErrorListener != null) { 
				if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err)) { 
					return true; 
				} 
			} 
Experience pair programming with AI  Get Codota for Java