Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
MediaScannerConnection.OnScanCompletedListener
android.media.MediaScannerConnection.OnScanCompletedListener
|
Known indirect subclasses
|
Interface for notifying clients of the result of scanning a
requested media file.
Summary
Public methods |
abstract
void
|
onScanCompleted(String path, Uri uri)
Called to notify the client when the media scanner has finished
scanning a file.
|
Public methods
onScanCompleted
public abstract void onScanCompleted (String path,
Uri uri)
Called to notify the client when the media scanner has finished
scanning a file.
Parameters |
path |
String : the path to the file that has been scanned. |
uri |
Uri : the Uri for the file if the scanning operation succeeded
and the file was added to the media database, or null if scanning failed. |
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,["# MediaScannerConnection.OnScanCompletedListener\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nMediaScannerConnection.OnScanCompletedListener\n==============================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaScannerConnection.OnScanCompletedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMediaScannerConnection.OnScanCompletedListener\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------------------|\n| android.media.MediaScannerConnection.OnScanCompletedListener |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [MediaScannerConnection.MediaScannerConnectionClient](/reference/android/media/MediaScannerConnection.MediaScannerConnectionClient) |-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MediaScannerConnection.MediaScannerConnectionClient](/reference/android/media/MediaScannerConnection.MediaScannerConnectionClient) | An interface for notifying clients of MediaScannerConnection when a connection to the MediaScanner service has been established and when the scanning of a file has completed. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for notifying clients of the result of scanning a\nrequested media file.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onScanCompleted](/reference/android/media/MediaScannerConnection.OnScanCompletedListener#onScanCompleted(java.lang.String,%20android.net.Uri))`(`[String](/reference/java/lang/String)` path, `[Uri](/reference/android/net/Uri)` uri) ` Called to notify the client when the media scanner has finished scanning a file. |\n\nPublic methods\n--------------\n\n### onScanCompleted\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onScanCompleted (String path, \n Uri uri)\n```\n\nCalled to notify the client when the media scanner has finished\nscanning a file.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| `path` | `String`: the path to the file that has been scanned. \u003cbr /\u003e |\n| `uri` | `Uri`: the Uri for the file if the scanning operation succeeded and the file was added to the media database, or null if scanning failed. \u003cbr /\u003e |"]]