Search code examples
androidandroid-intentintentfilter

Can one intent match multiple intent-filters of same application?


Since an application can define same intent filter for different components of the application, it's very likely that intent would match multiple component for the same application. What will happened if it is the case? Will there be any error?


Solution

  • What will happened if it is the case?

    Assuming that you are referring to startActivity(), then I would expect all matching activities from your app to appear in the chooser, along with any other activities on the device that match.

    Will there be any error?

    Probably not. Note, however, that what you are describing is very unusual. Usually, an application only needs one activity to respond to any given Intent structure.