ActivityFilter
class ActivityFilter
Filter for ActivityRule and SplitPlaceholderRule that checks for component name match when a new activity is started. If the filter matches the started activity Intent, 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 |
|---|
ActivityFilter(componentName: ComponentName, intentAction: String?)Constructs a new |
Public functions |
|
|---|---|
open operator Boolean |
|
open Int |
hashCode() |
Boolean |
matchesActivity(activity: Activity)Returns |
Boolean |
matchesIntent(intent: Intent)Returns |
open String |
toString() |
Public properties |
|
|---|---|
ComponentName |
|
String? |
Action used for activity launch intent. |
Public constructors
ActivityFilter
ActivityFilter(componentName: ComponentName, intentAction: String?)
Constructs a new ActivityFilter using a ComponentName and an Intent action.
| Parameters | |
|---|---|
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 - |
intentAction: String? |
Action used for activity launch intent. If it is not |
Public functions
matchesActivity
fun matchesActivity(activity: Activity): Boolean
Returns true if the ActivityFilter matches this Activity. If the ActivityFilter is created with an intent action, the filter will also compare it with Intent.getAction of Activity.getIntent.
matchesIntent
fun matchesIntent(intent: Intent): Boolean
Returns true if the ActivityFilter matches this Intent. If the ActivityFilter is created with an intent action, the filter will also compare it with Intent.getAction.
Public properties
componentName
val componentName: ComponentName
ComponentName that the ActivityFilter will use to match Activity and Intent.
intentAction
val intentAction: String?
Action used for activity launch intent.
If it is not null, the ActivityFilter will check the activity Intent.getAction besides the component name. If it is null, Intent.getAction will be ignored.