How many scheme & host tags can come under intent-filter in android manifest

前端 未结 2 404
情书的邮戳
情书的邮戳 2021-02-06 00:11

Need more info regarding intent-filter tag specified in manifest. I am aware that we can specify data in two forms:


     

        
2条回答
  •  庸人自扰
    2021-02-06 00:46

    I am aware that we can specify data in two forms

    Do not use content for a scheme, unless you truly mean that you are creating an activity in support of a ContentProvider.

    But I wish to know can several combinations exist

    If your filter has just one attribute for , you definitely can have different values, such as this from the Contacts app:

        
    
            
                
                
                
                
            
        
    

    Also, one component can have several elements, each of which is logically OR'd with the others (any Intent matching any filter is a match for the component). So for more complex scenarios, where you have 2+ attributes per element, I would be inclined to put those in separate elements.

    how is it decided that which host to be used for which scheme

    Any match is considered good. You would examine the Intent yourself to learn more about what it contains.

提交回复
热议问题