Android intent filter: associate app with file extension

后端 未结 16 1955
北海茫月
北海茫月 2020-11-22 11:06

I have a custom file type/extension that I want to associate my app with.

As far as I know, the data element is made for this purpose, but I can\'t get it working. h

16条回答
  •  执念已碎
    2020-11-22 11:52

    You need multiple intent filters to address different situation you want to handle.

    Example 1, handle http requests without mimetypes:

      
        
        
        
        
        
        
      
    

    Handle with mimetypes, where the suffix is irrelevant:

      
        
        
        
        
        
        
      
    

    Handle intent from a file browser app:

      
        
        
        
        
        
      
    

提交回复
热议问题