# StartComponentRequest.Builder

# StartComponentRequest.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder "View this page in Kotlin")\|Java

<br />

```
public final class StartComponentRequest.Builder
```

<br />

*** ** * ** ***

## Summary

|                                                                                             ### Public fields                                                                                              ||
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `final `[String](https://developer.android.com/reference/java/lang/String) | [action](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#action()) |
| `final `[String](https://developer.android.com/reference/java/lang/String) | [reason](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#reason()) |

|                                                         ### Public constructors                                                         ||
|--------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#Builder())`()` |

|                                                                                                                                                                                                                                                                                                                                                                                                   ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.String))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` key, @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` value)` Adds an extra string to the wakeup request that will be provided to the targeted app. |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.Boolean))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` key, boolean value)` Adds an extra boolean to the wakeup request that will be provided to the targeted app.                                                                                                                                              |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.Int))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` key, int value)` Adds an extra int to the wakeup request that will be provided to the targeted app.                                                                                                                                                          |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[StartComponentRequest.Builder](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder) | [addExtra](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#addExtra(kotlin.String,kotlin.ByteArray))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` key, @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` byte[] value)` Adds an extra ByteArray to the wakeup request that will be provided to the targeted app.                                                         |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[StartComponentRequest](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest)                 | [build](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#build())`()` Builds the[StartComponentRequest](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest)from this builder.                                                                                                                                                                                                                                                                                       |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[<Error class: unknown class>](https://developer.android.com/reference/[JVM root]/<Error class: unknown class>)                              | [setAction](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#setAction(kotlin.String))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` action)` (Required) Sets the intent action used to determine the target of the wakeup request.                                                                                                                                                                        |
| `final @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[<Error class: unknown class>](https://developer.android.com/reference/[JVM root]/<Error class: unknown class>)                              | [setReason](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#setReason(kotlin.String))`(@`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[String](https://developer.android.com/reference/java/lang/String)` reason)` (Required) Sets the user-visible reason for this request.                                                                                                                                                                                                    |

## Public fields

### action

```
public final String action
```  

### reason

```
public final String reason
```

## Public constructors

### Builder

```
public final Builder()
```

## Public methods

### addExtra

```
public final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, @NonNull String value)
```

Adds an extra string to the wakeup request that will be provided to the targeted app.  

### addExtra

```
public final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, boolean value)
```

Adds an extra boolean to the wakeup request that will be provided to the targeted app.  

### addExtra

```
public final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, int value)
```

Adds an extra int to the wakeup request that will be provided to the targeted app.  

### addExtra

```
public final @NonNull StartComponentRequest.Builder addExtra(@NonNull String key, @NonNull byte[] value)
```

Adds an extra ByteArray to the wakeup request that will be provided to the targeted app.  

### build

```
public final @NonNull StartComponentRequest build()
```

Builds the[StartComponentRequest](https://developer.android.com/reference/com/google/ambient/crossdevice/wakeup/StartComponentRequest)from this builder.  

|                                                                                              Throws                                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [java.lang.IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)` java.lang.IllegalArgumentException` | if required parameters are not specified. |

### 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.  

### setReason

```
public final @NonNull <Error class: unknown class> setReason(@NonNull String reason)
```

(Required) Sets the user-visible reason for this request.