Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder class for ChooserAction
objects
Summary
Public constructors |
Construct a new builder for ChooserAction object.
|
Public constructors
Builder
Builder(
icon: Icon,
label: CharSequence,
action: PendingIntent)
Construct a new builder for ChooserAction
object.
Parameters |
icon |
Icon: an Icon representing this action, consisting of a white foreground atop a transparent background. This value cannot be null . |
label |
CharSequence: label the user-readable label for this action. This value cannot be null . |
action |
PendingIntent: PendingIntent to be invoked when the action is selected. This value cannot be null . |
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,["# ChooserAction.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/chooser/ChooserAction.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.chooser.ChooserAction.Builder](#) |\n\nBuilder class for [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) objects\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.graphics.drawable.Icon,%20kotlin.CharSequence,%20android.app.PendingIntent))`(`icon:` `[Icon](../../graphics/drawable/Icon.html#)`, `label:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`, `action:` `[PendingIntent](../../app/PendingIntent.html#)`)` Construct a new builder for [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) object. |\n\n| Public methods ||\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) | [build](#build())`()` Combine all of the options that have been set and return a new [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) object. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(\n icon: Icon, \n label: CharSequence, \n action: PendingIntent)\n```\n\nConstruct a new builder for [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) object.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `icon` | [Icon](../../graphics/drawable/Icon.html#): an [Icon](../../graphics/drawable/Icon.html#) representing this action, consisting of a white foreground atop a transparent background. This value cannot be `null`. |\n| `label` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): label the user-readable label for this action. This value cannot be `null`. |\n| `action` | [PendingIntent](../../app/PendingIntent.html#): [PendingIntent](../../app/PendingIntent.html#) to be invoked when the action is selected. This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ChooserAction\n```\n\nCombine all of the options that have been set and return a new [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) object.\n\n| Return ||\n|--------------------------------------------------------------------------|-----------------------------------------------|\n| [ChooserAction](/reference/kotlin/android/service/chooser/ChooserAction) | the built action This value cannot be `null`. |"]]