Android intent filter: associate app with file extension

后端 未结 16 1711
北海茫月
北海茫月 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:51

    Content URI ftw, and with the intent filter in the manifest... if your files have a custom extension .xyz, add a matching mime type:

            
                
    
                
    
                
            
    

    Some apps such as email seem to convert the extension into a mime type. Now I can click on the attachment in email and have it open in my app.

提交回复
热议问题