android 关联某些后缀使用app打开

<intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="file" />
                <data android:scheme="content" />
                <data android:mimeType="*/*" />

                <data android:host="*" />

                <data android:pathPattern=".*\\.response" />
                <data android:pathPattern=".*\\..*\\.response" />
                <data android:pathPattern=".*\\..*\\..*\\.response" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.response" />

                <data android:pathPattern=".*\\.tx" />
                <data android:pathPattern=".*\\..*\\.tx" />
                <data android:pathPattern=".*\\..*\\..*\\.tx" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.tx" />

            </intent-filter>

 

重点是4层的pathPattern,stackoverflow的方案,没有深究原因,记录一下

只写一层是不行的,试了好久,坑。

posted @ 2019-11-04 19:07  带狗狗带  Views(545)  Comments(0Edit  收藏  举报