SplitPairFilter

public final class SplitPairFilter


Filter for 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 Activity.getComponentName and the new started activity Intent, it matches the SplitPairRule that holds this filter.

Summary

Public constructors

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

Public methods

boolean
equals(Object other)
final @NonNull ComponentName
final String
final @NonNull ComponentName
int
final boolean
matchesActivityIntentPair(
    @NonNull Activity primaryActivity,
    @NonNull Intent secondaryActivityIntent
)

Returns true if this SplitPairFilter matches the primaryActivity and the secondaryActivityIntent If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of the secondaryActivityIntent.

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

Returns true if this SplitPairFilter matches primaryActivity and secondaryActivity.

@NonNull String

Public constructors

SplitPairFilter

Added in 1.0.0
public SplitPairFilter(
    @NonNull ComponentName primaryActivityName,
    @NonNull ComponentName secondaryActivityName,
    String secondaryActivityIntentAction
)
Parameters
@NonNull ComponentName 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.*

  • */*

@NonNull ComponentName 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.*

  • */*

String secondaryActivityIntentAction

action used for secondary activity launch Intent. If it is not null, the SplitPairFilter will check the activity Intent.getAction besides the component name. If it is null, Intent.getAction will be ignored.

Public methods

equals

public boolean equals(Object other)

getPrimaryActivityName

Added in 1.0.0
public final @NonNull ComponentName getPrimaryActivityName()

getSecondaryActivityIntentAction

Added in 1.0.0
public final String getSecondaryActivityIntentAction()

getSecondaryActivityName

Added in 1.0.0
public final @NonNull ComponentName getSecondaryActivityName()

hashCode

public int hashCode()

matchesActivityIntentPair

Added in 1.0.0
public final boolean matchesActivityIntentPair(
    @NonNull Activity primaryActivity,
    @NonNull Intent secondaryActivityIntent
)

Returns true if this SplitPairFilter matches the primaryActivity and the secondaryActivityIntent If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of the secondaryActivityIntent.

Parameters
@NonNull Activity primaryActivity

the Activity to test against with the primaryActivityName

@NonNull Intent secondaryActivityIntent

the Intent to test against with the secondaryActivityName

matchesActivityPair

Added in 1.0.0
public final boolean matchesActivityPair(
    @NonNull Activity primaryActivity,
    @NonNull Activity secondaryActivity
)

Returns true if this SplitPairFilter matches primaryActivity and secondaryActivity. If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of Activity.getIntent of secondaryActivity.

Parameters
@NonNull Activity primaryActivity

the Activity to test against with the primaryActivityName

@NonNull Activity secondaryActivity

the Activity to test against with the secondaryActivityName

toString

public @NonNull String toString()