How intent and intent filter works in android? What are the sequence of tests done to map intent with an intent-filter?
all the above tests
When programmer starts a component by using an intent, to trigger appropriate component android will perform 3 tests.
1.action test : the action string of intent should match with at least one action string of intent filter.
2.data test : data and data type of intent should match with that of intent filter.
3.category test : all the categories of intent should be there in intent filter.
note: In case of implicit intent starting an activity, then default category will be automatically added to intent.
If there is any component in manifest file with an intent filter which passes all the 3 tests, then android will trigger that component. Else not.
If there are multiple components satisfying that intent, and if it is not a broadcast receiver, then it will ask user to make a decision.
Back To Top