Stay organized with collections
Save and categorize content based on your preferences.
DownloadListener
interface DownloadListener
Summary
Public methods |
abstract Unit |
Notify the host application that a file should be downloaded
|
Public methods
onDownloadStart
abstract fun onDownloadStart(
url: String!,
userAgent: String!,
contentDisposition: String!,
mimetype: String!,
contentLength: Long
): Unit
Notify the host application that a file should be downloaded
Parameters |
url |
String!: The full url to the content that should be downloaded |
userAgent |
String!: the user agent to be used for the download. |
contentDisposition |
String!: Content-disposition http header, if present. |
mimetype |
String!: The mimetype of the content reported by the server |
contentLength |
Long: The file size reported by the server |
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,["# DownloadListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDownloadListener\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/DownloadListener \"View this page in Java\") \n\n```\ninterface DownloadListener\n```\n\n|--------------------------------------|\n| [android.webkit.DownloadListener](#) |\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDownloadStart](#onDownloadStart(kotlin.String,%20kotlin.String,%20kotlin.String,%20kotlin.String,%20kotlin.Long))`(`url:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `userAgent:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `contentDisposition:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `mimetype:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `contentLength:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Notify the host application that a file should be downloaded |\n\nPublic methods\n--------------\n\n### onDownloadStart\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onDownloadStart(\n url: String!, \n userAgent: String!, \n contentDisposition: String!, \n mimetype: String!, \n contentLength: Long\n): Unit\n```\n\nNotify the host application that a file should be downloaded\n\n| Parameters ||\n|----------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `url` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The full url to the content that should be downloaded |\n| `userAgent` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the user agent to be used for the download. |\n| `contentDisposition` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: Content-disposition http header, if present. |\n| `mimetype` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The mimetype of the content reported by the server |\n| `contentLength` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The file size reported by the server |"]]