# ActivityRule.Builder

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/embedding/ActivityRule.kt+class:androidx.window.embedding.ActivityRule.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

*** ** * ** ***


```
public final class ActivityRule.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/window/embedding/ActivityRule`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder#Builder(kotlin.collections.Set)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityFilter> filters)` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityRule` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder#build()()` Builds an `ActivityRule` instance. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder#setAlwaysExpand(kotlin.Boolean)(boolean alwaysExpand)` Sets whether the activity should always be expanded on launch. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder#setTag(kotlin.String)(https://developer.android.com/reference/java/lang/String.html tag)` Sets a unique string to identify this `https://developer.android.com/reference/androidx/window/embedding/ActivityRule`, which defaults to `null`. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

```
public Builder(@NonNull Set<@NonNull ActivityFilter> filters)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityFilter> filters` | See `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#filters()`. |

## Public methods

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

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

Builds an `ActivityRule` instance.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/ActivityRule` | The new `ActivityRule` instance. |

### setAlwaysExpand

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

```
public final @NonNull ActivityRule.Builder setAlwaysExpand(boolean alwaysExpand)
```

Sets whether the activity should always be expanded on launch. Some activities are supposed to expand to the full task bounds, independent of the state of the split. An example is an activity that blocks all user interactions, such as a warning dialog.

| Parameters |
|---|---|
| `boolean alwaysExpand` | whether the activity should always be expanded on launch. |

### setTag

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

```
public final @NonNull ActivityRule.Builder setTag(String tag)
```

Sets a unique string to identify this `https://developer.android.com/reference/androidx/window/embedding/ActivityRule`, which defaults to `null`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html tag` | unique string to identify this `https://developer.android.com/reference/androidx/window/embedding/ActivityRule`. |