Stay organized with collections
Save and categorize content based on your preferences.
StartComponentRequest.Builder
public final class StartComponentRequest.Builder
Summary
Public fields
Public constructors
Public methods
setAction
public final @NonNull <Error class: unknown class> setAction(@NonNull String action)
(Required) Sets the intent action used to determine the target of the wakeup request.
This intent action is used to resolve the target component (only Activity targets are currently supported) on the receiving device.
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,["# StartComponentRequest.Builder\n=============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder \"View this page in Kotlin\") \\|Java\n\n\n```\npublic final class StartComponentRequest.Builder\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public fields ||\n|-----------------------------------------------|---------------------------------------------------------------------------------------------------|\n| `final `[String](/reference/java/lang/String) | [action](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#action()) |\n| `final `[String](/reference/java/lang/String) | [reason](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#reason()) |\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------|---|\n| [Builder](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#Builder())`()` |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.String))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` key, @`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` value)` Adds an extra string to the wakeup request that will be provided to the targeted app. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.Boolean))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` key, boolean value)` Adds an extra boolean to the wakeup request that will be provided to the targeted app. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.Int))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` key, int value)` Adds an extra int to the wakeup request that will be provided to the targeted app. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.ByteArray))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` key, @`[NonNull](/reference/androidx/annotation/NonNull)` byte[] value)` Adds an extra ByteArray to the wakeup request that will be provided to the targeted app. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[StartComponentRequest](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest) | [build](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#build())`()` Builds the [StartComponentRequest](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest) from this builder. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[\u003cError class: unknown class\u003e](/reference/[JVM root]/\u003cError class: unknown class\u003e) | [setAction](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#setAction(kotlin.String))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` action)` (Required) Sets the intent action used to determine the target of the wakeup request. |\n| `final @`[NonNull](/reference/androidx/annotation/NonNull)` `[\u003cError class: unknown class\u003e](/reference/[JVM root]/\u003cError class: unknown class\u003e) | [setReason](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#setReason(kotlin.String))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[String](/reference/java/lang/String)` reason)` (Required) Sets the user-visible reason for this request. |\n\nPublic fields\n-------------\n\n### action\n\n```\npublic final String action\n``` \n\n### reason\n\n```\npublic final String reason\n```\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\npublic final Builder()\n```\n\nPublic methods\n--------------\n\n### addExtra\n\n```\npublic final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, @NonNull String value)\n```\n\nAdds an extra string to the wakeup request that will be provided to the targeted app. \n\n### addExtra\n\n```\npublic final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, boolean value)\n```\n\nAdds an extra boolean to the wakeup request that will be provided to the targeted app. \n\n### addExtra\n\n```\npublic final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, int value)\n```\n\nAdds an extra int to the wakeup request that will be provided to the targeted app. \n\n### addExtra\n\n```\npublic final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, @NonNull byte[] value)\n```\n\nAdds an extra ByteArray to the wakeup request that will be provided to the targeted app. \n\n### build\n\n```\npublic final @NonNull StartComponentRequest build()\n```\n\nBuilds the [StartComponentRequest](/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest) from this builder. \n\n| Throws ||\n|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|\n| [java.lang.IllegalArgumentException](/reference/java/lang/IllegalArgumentException)` java.lang.IllegalArgumentException` | if required parameters are not specified. |\n\n### setAction\n\n```\npublic final @NonNull \u003cError class: unknown class\u003e setAction(@NonNull String action)\n```\n\n(Required) Sets the intent action used to determine the target of the wakeup request.\n\nThis intent action is used to resolve the target component (only Activity targets are currently supported) on the receiving device. \n\n### setReason\n\n```\npublic final @NonNull \u003cError class: unknown class\u003e setReason(@NonNull String reason)\n```\n\n(Required) Sets the user-visible reason for this request."]]