What are Intent Filters exactly?

后端 未结 7 1635
我寻月下人不归
我寻月下人不归 2021-02-04 02:31

I\'ve read lots of articles about intent filters and I really can\'t understand exactly what they do?

so please if anybody can explain to me with a clear example what is

7条回答
  •  心在旅途
    2021-02-04 03:25

    An intent filter lets the system know what data or service requests a component can handle. A component might be an activity, service or broadcast receiver.

    If you are writing an image viewer, you would add an intent filter (or several) to the manifest describing the images you can handle. If you are writing a file browser, you might package up the details of an image file in an intent, and the system would sift through intent filters until it found a best match to handle that image. The same goes for any type of data or service that might be passed from one component to the next.

提交回复
热议问题