# StartComponentRequest.Builder

# StartComponentRequest.Builder

*** ** * ** ***

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


```
class StartComponentRequest.Builder
```

<br />

*** ** * ** ***

## Summary

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

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

|                                                                                              ### Public properties                                                                                               ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/kotlin/kotlin/String)`?` | [action](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#action()) |
| [String](https://developer.android.com/reference/kotlin/kotlin/String)`?` | [reason](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest.Builder#reason()) |

## Public constructors

### Builder

```
Builder()
```

## Public functions

### addExtra

```
fun addExtra(key: String, value: String): StartComponentRequest.Builder
```

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

### addExtra

```
fun addExtra(key: String, value: Boolean): StartComponentRequest.Builder
```

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

### addExtra

```
fun addExtra(key: String, value: Int): StartComponentRequest.Builder
```

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

### addExtra

```
fun addExtra(key: String, value: ByteArray): StartComponentRequest.Builder
```

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

### build

```
fun build(): StartComponentRequest
```

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

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

### setAction

```
fun setAction(action: String): <Error class: unknown class>
```

(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

```
fun setReason(reason: String): <Error class: unknown class>
```

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

## Public properties

### action

```
var action: String?
```  

### reason

```
var reason: String?
```