Most visited

Recently visited

Added in API level 1

MediaPlayer.OnErrorListener

public static interface MediaPlayer.OnErrorListener

android.media.MediaPlayer.OnErrorListener


在异步操作期间发生错误时要调用的回调的接口定义(其他错误将在方法调用时引发异常)。

摘要(Summary)

公共方法(Public methods)

abstract boolean onError(MediaPlayer mp, int what, int extra)

被调用以指示错误。

公共方法(Public methods)

onError

Added in API level 1
boolean onError (MediaPlayer mp, 
                int what, 
                int extra)

被调用以指示错误。

参数(Parameters)
mp MediaPlayer: the MediaPlayer the error pertains to
what int: the type of error that has occurred:
extra int: an extra code, specific to the error. Typically implementation dependent.
返回(Returns)
boolean True if the method handled the error, false if it didn't. Returning false, or not having an OnErrorListener at all, will cause the OnCompletionListener to be called.

Hooray!