Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
MediaRecorder.OnErrorListener
android.media.MediaRecorder.OnErrorListener
|
Interface definition for a callback to be invoked when an error
occurs while recording.
Summary
Public methods |
abstract
void
|
onError(MediaRecorder mr, int what, int extra)
Called when an error occurs while recording.
|
Public methods
public abstract void onError (MediaRecorder mr,
int what,
int extra)
Called when an error occurs while recording.
Parameters |
mr |
MediaRecorder : the MediaRecorder that encountered the error |
what |
int : the type of error that has occurred:
|
extra |
int : an extra code, specific to the error type |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MediaRecorder.OnErrorListener\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nMediaRecorder.OnErrorListener\n=============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaRecorder.OnErrorListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMediaRecorder.OnErrorListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------|\n| android.media.MediaRecorder.OnErrorListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when an error\noccurs while recording.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onError](/reference/android/media/MediaRecorder.OnErrorListener#onError(android.media.MediaRecorder,%20int,%20int))`(`[MediaRecorder](/reference/android/media/MediaRecorder)` mr, int what, int extra) ` Called when an error occurs while recording. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onError (MediaRecorder mr, \n int what, \n int extra)\n```\n\nCalled when an error occurs while recording.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mr` | `MediaRecorder`: the MediaRecorder that encountered the error \u003cbr /\u003e |\n| `what` | `int`: the type of error that has occurred: - [MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN](/reference/android/media/MediaRecorder#MEDIA_RECORDER_ERROR_UNKNOWN) - [MediaRecorder.MEDIA_ERROR_SERVER_DIED](/reference/android/media/MediaRecorder#MEDIA_ERROR_SERVER_DIED) \u003cbr /\u003e |\n| `extra` | `int`: an extra code, specific to the error type \u003cbr /\u003e |"]]