Code example for MediaPlayer.OnCompletionListener

Methods: onCompletion

0
 
				@Override 
				public void onCompletion(MediaPlayer mp) {
					// TODO Auto-generated method stub 
					if (ocl != null)
						ocl.onCompletion(mediaPlayer);
					if (mediaPlayer != null) {
						mediaPlayer.stop();
						mediaPlayer.release();
					} 
					mode = MODE_STANDBY;
				} 
			}); 
 
			Log.d("BackgroundMusic", "Start opening:" + filename);
			if (filename.startsWith(DEFAULT_MUSICS_FOLDER_PATH)) {
				Log.d("BackgroundMusic", "in folder:" + filename);
				// mediaPlayer.setDataSource(filename); 
				// MediaPlayer mPlayer = new MediaPlayer(); 
				// example of mediaFile