创建打开自定义文件扩展名的应用

top*_*her 9 android file

想要创建一个Android应用程序,它打开一个自定义构建文件扩展名(例如,我想打开.abcd文件)

它类似于Adobe Reader,可打开.pdf文件或打开.jpg文件的Photo Viewer

具体条件:
1..abcd文件应位于应用程序本身的外部/外部.(.pdf是Adobe Reader)
2..abcd文件是一个压缩文件,包含几个文件夹和.xml,.txt和.jpg文件.我想,我想提取它-也许暂时-在存储的地方(当然需要一个拉链/ unzipper库),然后读取个人的.xml,.txt和.jpg文件.

寻找这个问题的见解和答案.

附加信息:
我对Android编程比较陌生.

rid*_*doy 7

我认为您需要通过以下方式进行这种类型的自定义intent-filter:

<intent-filter android:icon="your_drawable-resource"
               android:label="your_string_resource"
               android:priority="integer"> 
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="file" />
    <data android:host="*" />
    <data android:pathPattern=".*\\.YOUR_CUSTOM_FILE_EXTENSION" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

你应该看看: