Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for construction of DirectAction.
Summary
Public constructors |
Creates a new instance.
|
Public constructors
Builder
Builder(id: String)
Creates a new instance.
Parameters |
id |
String: The mandatory action id which must be unique in the current application state. This value cannot be null . |
Public methods
fun setExtras(extras: Bundle?): DirectAction.Builder
Sets the optional action extras. These extras are action specific and their semantics are open-ended potentially representing how the action is visualized, interpreted, what its arguments are, etc.
Parameters |
extras |
Bundle?: The extras. This value may be null . |
setLocusId
fun setLocusId(locusId: LocusId?): DirectAction.Builder
Sets the optional locus id. This is an identifier of the application state from a user perspective. For example, a specific chat in a messaging app.
Parameters |
locusId |
LocusId?: The locus id. This value may be null . |
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,["# DirectAction.Builder\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/DirectAction.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.app.DirectAction.Builder](#) |\n\nBuilder for construction of DirectAction.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.String))`(`id:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a new instance. |\n\n| Public methods ||\n|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [DirectAction](/reference/kotlin/android/app/DirectAction) | [build](#build())`()` \u003cbr /\u003e |\n| [DirectAction.Builder](#) | [setExtras](#setExtras(android.os.Bundle))`(`extras:` `[Bundle](../os/Bundle.html#)?`)` Sets the optional action extras. |\n| [DirectAction.Builder](#) | [setLocusId](#setLocusId(android.content.LocusId))`(`locusId:` `[LocusId](../content/LocusId.html#)?`)` Sets the optional locus id. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(id: String)\n```\n\nCreates a new instance.\n\n| Parameters ||\n|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The mandatory action id which must be unique in the current application state. This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): DirectAction\n```\n\n| Return ||\n|------------------------------------------------------------|------------------------------------------------------------|\n| [DirectAction](/reference/kotlin/android/app/DirectAction) | A newly constructed instance. This value cannot be `null`. |\n\n### setExtras\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setExtras(extras: Bundle?): DirectAction.Builder\n```\n\nSets the optional action extras. These extras are action specific and their semantics are open-ended potentially representing how the action is visualized, interpreted, what its arguments are, etc.\n\n| Parameters ||\n|----------|----------------------------------------------------------------------|\n| `extras` | [Bundle](../os/Bundle.html#)?: The extras. This value may be `null`. |\n\n| Return ||\n|---------------------------|--------------------------------------------|\n| [DirectAction.Builder](#) | This builder. This value cannot be `null`. |\n\n### setLocusId\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setLocusId(locusId: LocusId?): DirectAction.Builder\n```\n\nSets the optional locus id. This is an identifier of the application state from a user perspective. For example, a specific chat in a messaging app.\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------|\n| `locusId` | [LocusId](../content/LocusId.html#)?: The locus id. This value may be `null`. |\n\n| Return ||\n|---------------------------|--------------------------------------------|\n| [DirectAction.Builder](#) | This builder. This value cannot be `null`. |"]]