# ActivityRule

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) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/window#1.0.0)

*** ** * ** ***

<br />

```
public final class ActivityRule extends EmbeddingRule
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.window.embedding.EmbeddingRule](https://developer.android.com/reference/androidx/window/embedding/EmbeddingRule) ||
|   | ↳ | [androidx.window.embedding.ActivityRule](https://developer.android.com/reference/androidx/window/embedding/ActivityRule) |

*** ** * ** ***

Layout configuration rules for individual activities with split layouts. Take precedence over `https://developer.android.com/reference/androidx/window/embedding/SplitPairRule`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/window/embedding/ActivityRule.Builder` Builder for `https://developer.android.com/reference/androidx/window/embedding/ActivityRule`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final boolean` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#getAlwaysExpand()()` Whether the activity should always be expanded on launch. |
| `final @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>` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#getFilters()()` Filters used to choose when to apply this rule. |
| `int` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/window/embedding/ActivityRule#toString()()` |

### Inherited methods

From [androidx.window.embedding.EmbeddingRule](https://developer.android.com/reference/androidx/window/embedding/EmbeddingRule) `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/window/embedding/EmbeddingRule#getTag()()`

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAlwaysExpand

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

```
public final boolean getAlwaysExpand()
```

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.

### getFilters

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

```
public final @NonNull Set<@NonNull ActivityFilter> getFilters()
```

Filters used to choose when to apply this rule. The rule will be applied if any one of the provided filters matches.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```