Stay organized with collections
Save and categorize content based on your preferences.
Browser
open class Browser
Summary
Constants |
static String |
The name of the extra data when starting the Browser from another application.
|
static String |
Boolean extra passed along with an Intent to a browser, specifying that a new tab be created.
|
static String |
The name of the extra data in the VIEW intent.
|
static String |
The name of extra data when starting Browser with ACTION_VIEW or ACTION_SEARCH intent.
|
Public methods |
static Unit |
Sends the given string using an Intent with Intent.ACTION_SEND and a mime type of text/plain.
|
Constants
static val EXTRA_APPLICATION_ID: String
The name of the extra data when starting the Browser from another application.
The value is a unique identification string that will be used to identify the calling application. The Browser will attempt to reuse the same window each time the application launches the Browser with the same identifier.
Value: "com.android.browser.application_id"
static val EXTRA_CREATE_NEW_TAB: String
Boolean extra passed along with an Intent to a browser, specifying that a new tab be created. Overrides EXTRA_APPLICATION_ID; if both are set, a new tab will be used, rather than using the same one.
Value: "create_new_tab"
static val EXTRA_HEADERS: String
The name of the extra data in the VIEW intent. The data are key/value pairs in the format of Bundle. They will be sent in the HTTP request headers for the provided url. The keys can't be the standard HTTP headers as they are set by the WebView. The url's schema must be http(s).
Value: "com.android.browser.headers"
INITIAL_ZOOM_LEVEL
static val INITIAL_ZOOM_LEVEL: String
The name of extra data when starting Browser with ACTION_VIEW or ACTION_SEARCH intent.
The value should be an integer between 0 and 1000. If not set or set to 0, the Browser will use default. If set to 100, the Browser will start with 100%.
Value: "browser.initialZoomLevel"
Public constructors
Public methods
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,["# Browser\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBrowser\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/Browser \"View this page in Java\") \n\n```\nopen class Browser\n```\n\n|---|-------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.Browser](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_APPLICATION_ID](#EXTRA_APPLICATION_ID:kotlin.String) The name of the extra data when starting the Browser from another application. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_CREATE_NEW_TAB](#EXTRA_CREATE_NEW_TAB:kotlin.String) Boolean extra passed along with an Intent to a browser, specifying that a new tab be created. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_HEADERS](#EXTRA_HEADERS:kotlin.String) The name of the extra data in the VIEW intent. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [INITIAL_ZOOM_LEVEL](#INITIAL_ZOOM_LEVEL:kotlin.String) The name of extra data when starting Browser with ACTION_VIEW or ACTION_SEARCH intent. |\n\n| Public constructors ||\n|----------------------------------|---|\n| [Browser](#Browser())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [sendString](#sendString(android.content.Context,%20kotlin.String))`(`context:` `[Context](../content/Context.html#)!`, `string:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sends the given string using an Intent with [Intent.ACTION_SEND](../content/Intent.html#ACTION_SEND:kotlin.String) and a mime type of text/plain. |\n\nConstants\n---------\n\n### EXTRA_APPLICATION_ID\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_APPLICATION_ID: String\n```\n\nThe name of the extra data when starting the Browser from another application.\n\nThe value is a unique identification string that will be used to identify the calling application. The Browser will attempt to reuse the same window each time the application launches the Browser with the same identifier. \n\n Value: \"com.android.browser.application_id\"\n\n### EXTRA_CREATE_NEW_TAB\n\nAdded in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_CREATE_NEW_TAB: String\n```\n\nBoolean extra passed along with an Intent to a browser, specifying that a new tab be created. Overrides EXTRA_APPLICATION_ID; if both are set, a new tab will be used, rather than using the same one. \n\n Value: \"create_new_tab\"\n\n### EXTRA_HEADERS\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_HEADERS: String\n```\n\nThe name of the extra data in the VIEW intent. The data are key/value pairs in the format of Bundle. They will be sent in the HTTP request headers for the provided url. The keys can't be the standard HTTP headers as they are set by the WebView. The url's schema must be http(s).\n\n\u003cbr /\u003e\n\n Value: \"com.android.browser.headers\"\n\n### INITIAL_ZOOM_LEVEL\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val INITIAL_ZOOM_LEVEL: String\n```\n\nThe name of extra data when starting Browser with ACTION_VIEW or ACTION_SEARCH intent.\n\nThe value should be an integer between 0 and 1000. If not set or set to 0, the Browser will use default. If set to 100, the Browser will start with 100%. \n\n Value: \"browser.initialZoomLevel\"\n\nPublic constructors\n-------------------\n\n### Browser\n\n```\nBrowser()\n```\n\nPublic methods\n--------------\n\n### sendString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun sendString(\n context: Context!, \n string: String!\n): Unit\n```\n\nSends the given string using an Intent with [Intent.ACTION_SEND](../content/Intent.html#ACTION_SEND:kotlin.String) and a mime type of text/plain. The string is put into [Intent.EXTRA_TEXT](../content/Intent.html#EXTRA_TEXT:kotlin.String).\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------|\n| `context` | [Context](../content/Context.html#)!: the context used to start the activity |\n| `string` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the string to send |"]]