ActivityFilter

@ExperimentalWindowApi public final class ActivityFilter


Filter for ActivityRule that checks for component name match. 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 fields

final @NonNull ComponentName

Component name in the intent for the activity.

final String

Action used for activity launch intent.

Public constructors

ActivityFilter(ComponentName componentName, String intentAction)

Public methods

boolean
equals(Object other)
int
final boolean
final boolean
@NonNull String

Public fields

componentName

public final @NonNull ComponentName componentName

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

public final String intentAction

Action used for activity launch intent.

To match with intents based only on the Intent.getAction, use a wildcard (*/*) with componentName.

Public constructors

ActivityFilter

public final ActivityFilter(ComponentName componentName, String intentAction)

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

matchesActivity

public final boolean matchesActivity(Activity activity)

matchesIntent

public final boolean matchesIntent(Intent intent)