Intent filter for files only

前端 未结 2 1851
梦谈多话
梦谈多话 2021-02-13 16:48

in our app, we want to appear in the \"Share via\" menu. So we added this intent-filter to our activity :


    

        
2条回答
  •  无人共我
    2021-02-13 17:20

    we want to appear in the menu for all files, whatever there mime type is

    Try a MIME type of */*.

    we want to appear only for files. And up to now, if the user wants to share a simple text, as its mime type will be text/plain, our app appears in the menu and we don't want it. We tried to add scheme=file and host="" or "*" and it doesn't work as many app use a scheme=content to share file based content.

    Then have two elements, one for a scheme of content and one for a scheme of file.

    
    
    
    

    However, bear in mind that a content scheme does not mean that it is necessarily a file.

提交回复
热议问题