androidintentfilter

Why Label Intent Filters?


Just getting my hands around intent filters, and I've noticed a rather hit and miss approach to labeling intent-filters using android:label in both sample code and other online sources, yet haven't been able to find a definitive explanation for the purpose of labeling.

Can anyone point me in the right direction?

Thanks,

Paul


Solution

  • Basic example:

    It's explained in the official documentation:

    A user-readable label for the parent component. This label, rather than the one set by the parent component, is used when the component is presented to the user as having the capability described by the filter.

    The label is set as a reference to a string resource so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

    The default value is the label set by the parent component. If the parent doesn't specify a label, the default is the label set by the <application> element's label attribute.