Code example for MediaPlayer.OnErrorListener

Methods: onError

0
 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; 
	                } 
	            } 
 
	            return true; 
	        } 
	    }; 
	  //×¢²áÔÚÉèÖûò²¥·Å¹ý³ÌÖз¢Éú´íÎóʱµ÷ÓõĻص÷º¯Êý¡£Èç¹ûδָ¶¨»Øµ÷º¯Êý£¬ »ò»Øµ÷º¯Êý·µ»Ø¼Ù£¬VideoView »á֪ͨÓû§·¢ÉúÁË´íÎó¡£ 
 
 public void setOnErrorListener(OnErrorListener l)
 { 
     mOnErrorListener = l;
 } 
 //ÊÓƵ²¥·ÅÍê³Éʱµ÷ÓõĻص÷º¯Êý 
 public void setOnCompletionListener(OnCompletionListener l)//×¢²áÔÚýÌåÎļþ²¥·ÅÍê±Ïʱµ÷ÓõĻص÷º¯Êý