# ActivityFilter

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

*** ** * ** ***

<br />

```
class ActivityFilter
```

<br />

*** ** * ** ***

Filter for `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityRule` and `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPlaceholderRule` that checks for component name match when a new activity is started. If the filter matches the started activity `https://developer.android.com/reference/android/content/Intent.html`, the activity will then apply the rule based on the match result. This filter allows a wildcard symbol in the end or instead of the package name, and a wildcard symbol in the end or instead of the class name.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#ActivityFilter(android.content.ComponentName,kotlin.String)(componentName: https://developer.android.com/reference/android/content/ComponentName.html, intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Constructs a new `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` using a `https://developer.android.com/reference/android/content/ComponentName.html` and an `https://developer.android.com/reference/android/content/Intent.html` action. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#matchesActivity(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` Returns `true` if the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` matches this `https://developer.android.com/reference/android/app/Activity.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#matchesIntent(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns `true` if the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` matches this `https://developer.android.com/reference/android/content/Intent.html`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#componentName()` `https://developer.android.com/reference/android/content/ComponentName.html` that the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` will use to match `https://developer.android.com/reference/android/app/Activity.html` and `https://developer.android.com/reference/android/content/Intent.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter#intentAction()` Action used for activity launch intent. |

## Public constructors

### ActivityFilter

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

```
ActivityFilter(componentName: ComponentName, intentAction: String?)
```

Constructs a new `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` using a `https://developer.android.com/reference/android/content/ComponentName.html` and an `https://developer.android.com/reference/android/content/Intent.html` action.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | Component name in the intent for the activity. Must be non-empty. Can contain a single wildcard at the end. Supported formats: - package/class - `package/*` - `package/suffix.*` - `*/*` |
| `intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | Action used for activity launch intent. If it is not `null`, the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` will check the activity `https://developer.android.com/reference/android/content/Intent.html#getAction()` besides the component name. If it is `null`, `https://developer.android.com/reference/android/content/Intent.html#getAction()` will be ignored. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### matchesActivity

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

```
fun matchesActivity(activity: Activity): Boolean
```

Returns `true` if the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` matches this `https://developer.android.com/reference/android/app/Activity.html`. If the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` is created with an intent action, the filter will also compare it with `https://developer.android.com/reference/android/content/Intent.html#getAction()` of `https://developer.android.com/reference/android/app/Activity.html#getIntent()`.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/android/app/Activity.html` | the `https://developer.android.com/reference/android/app/Activity.html` to test against. |

### matchesIntent

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

```
fun matchesIntent(intent: Intent): Boolean
```

Returns `true` if the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` matches this `https://developer.android.com/reference/android/content/Intent.html`. If the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` is created with an intent action, the filter will also compare it with `https://developer.android.com/reference/android/content/Intent.html#getAction()`.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the `https://developer.android.com/reference/android/content/Intent.html` to test against. |

### toString

```
open fun toString(): String
```

## Public properties

### componentName

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

```
val componentName: ComponentName
```

`https://developer.android.com/reference/android/content/ComponentName.html` that the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` will use to match `https://developer.android.com/reference/android/app/Activity.html` and `https://developer.android.com/reference/android/content/Intent.html`.

### intentAction

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

```
val intentAction: String?
```

Action used for activity launch intent.

If it is not `null`, the `https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityFilter` will check the activity `https://developer.android.com/reference/android/content/Intent.html#getAction()` besides the component name. If it is `null`, `https://developer.android.com/reference/android/content/Intent.html#getAction()` will be ignored.