Register to be default app for custom file type

前端 未结 4 1142
执念已碎
执念已碎 2020-11-29 06:13

Register to be able to open files of custom type. Say i have .cool files, and if the user tries to open it, Android asks if they would like to open it with my application. H

4条回答
  •  野性不改
    2020-11-29 06:31

    You can add the following to the AndroidManifest.xml file inside the activity that has to open the file (pdf in our case)

            
                
                
                
            
    

    Make sure you specify the proper mime format. The user will be prompted to choose your app if she wants to open the "pdf" file.

    Check also Android intent filter: associate app with file extension for more details.

提交回复
热议问题