# SplitPairFilter

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

*** ** * ** ***

<br />

```
public final class SplitPairFilter
```

<br />

*** ** * ** ***

Filter for `https://developer.android.com/reference/androidx/window/embedding/SplitPairRule` and used to find if a pair of activities should be put in a split. It is used when a new activity is started from the primary activity. If the filter matches the primary `https://developer.android.com/reference/android/app/Activity.html#getComponentName()` and the new started activity `https://developer.android.com/reference/android/content/Intent.html`, it matches the `https://developer.android.com/reference/androidx/window/embedding/SplitPairRule` that holds this filter.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#SplitPairFilter(android.content.ComponentName,android.content.ComponentName,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html primaryActivityName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html secondaryActivityName, https://developer.android.com/reference/java/lang/String.html secondaryActivityIntentAction )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#getPrimaryActivityName()()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#getSecondaryActivityIntentAction()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#getSecondaryActivityName()()` |
| `int` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html primaryActivity, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html secondaryActivityIntent )` Returns `true` if this `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` matches the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)` and the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)` If the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` is created with `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#secondaryActivityIntentAction()`, the filter will also compare it with `https://developer.android.com/reference/android/content/Intent.html#getAction()` of the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)`. |
| `final boolean` | `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html primaryActivity, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html secondaryActivity )` Returns `true` if this `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` matches `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)` and `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)`. |
| `@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/SplitPairFilter#toString()()` |

## Public constructors

### SplitPairFilter

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

```
public SplitPairFilter(
    @NonNull ComponentName primaryActivityName,
    @NonNull ComponentName secondaryActivityName,
    String secondaryActivityIntentAction
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html primaryActivityName` | Component name of the primary activity in the split. Must be non-empty. Can contain a single wildcard at the end. Supported formats: - package/class - `package/*` - `package/suffix.*` - `*/*` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html secondaryActivityName` | Component name of the secondary activity in the split. Must be non-empty. Can contain a single wildcard at the end. Supported formats: - package/class - `package/*` - `package/suffix.*` - `*/*` |
| `https://developer.android.com/reference/java/lang/String.html secondaryActivityIntentAction` | action used for secondary activity launch Intent. If it is not `null`, the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` 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 methods

### equals

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

### getPrimaryActivityName

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

```
public final @NonNull ComponentName getPrimaryActivityName()
```

### getSecondaryActivityIntentAction

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

```
public final String getSecondaryActivityIntentAction()
```

### getSecondaryActivityName

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

```
public final @NonNull ComponentName getSecondaryActivityName()
```

### hashCode

```
public int hashCode()
```

### matchesActivityIntentPair

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

```
public final boolean matchesActivityIntentPair(
    @NonNull Activity primaryActivity,
    @NonNull Intent secondaryActivityIntent
)
```

Returns `true` if this `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` matches the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)` and the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)` If the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` is created with `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#secondaryActivityIntentAction()`, the filter will also compare it with `https://developer.android.com/reference/android/content/Intent.html#getAction()` of the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityIntentPair(android.app.Activity,android.content.Intent)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html primaryActivity` | the `https://developer.android.com/reference/android/app/Activity.html` to test against with the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#primaryActivityName()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html secondaryActivityIntent` | the `https://developer.android.com/reference/android/content/Intent.html` to test against with the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#secondaryActivityName()` |

### matchesActivityPair

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

```
public final boolean matchesActivityPair(
    @NonNull Activity primaryActivity,
    @NonNull Activity secondaryActivity
)
```

Returns `true` if this `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` matches `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)` and `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)`. If the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter` is created with `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#secondaryActivityIntentAction()`, 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()` of `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#matchesActivityPair(android.app.Activity,android.app.Activity)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html primaryActivity` | the `https://developer.android.com/reference/android/app/Activity.html` to test against with the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#primaryActivityName()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html secondaryActivity` | the `https://developer.android.com/reference/android/app/Activity.html` to test against with the `https://developer.android.com/reference/androidx/window/embedding/SplitPairFilter#secondaryActivityName()` |

### toString

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