Stay organized with collections
Save and categorize content based on your preferences.
OnScanCompletedListener
interface OnScanCompletedListener
Interface for notifying clients of the result of scanning a requested media file.
Summary
Public methods |
abstract Unit |
Called to notify the client when the media scanner has finished scanning a file.
|
Public methods
onScanCompleted
abstract fun onScanCompleted(
path: String!,
uri: Uri!
): Unit
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaScannerConnection.OnScanCompletedListener\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnScanCompletedListener\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaScannerConnection.OnScanCompletedListener \"View this page in Java\") \n\n```\ninterface OnScanCompletedListener\n```\n\n|-------------------------------------------------------------------|\n| [android.media.MediaScannerConnection.OnScanCompletedListener](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [MediaScannerConnection.MediaScannerConnectionClient](/reference/kotlin/android/media/MediaScannerConnection.MediaScannerConnectionClient) |--------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MediaScannerConnection.MediaScannerConnectionClient](/reference/kotlin/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\nInterface for notifying clients of the result of scanning a requested media file.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onScanCompleted](#onScanCompleted(kotlin.String,%20android.net.Uri))`(`path:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `uri:` `[Uri](../net/Uri.html#)!`)` 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onScanCompleted(\n path: String!, \n uri: Uri!\n): Unit\n```\n\nCalled to notify the client when the media scanner has finished scanning a file.\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `path` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the path to the file that has been scanned. |\n| `uri` | [Uri](../net/Uri.html#)!: the Uri for the file if the scanning operation succeeded and the file was added to the media database, or null if scanning failed. |"]]