Android的意图过滤器pathPattern [英] Android intent-filter pathPattern

查看:198
本文介绍了Android的意图过滤器pathPattern的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打的意图过滤器,可以检测到的网址像这样的:

 的http://192.168.0.xx/playlist/_definst_/iphone.smil/list.m3u8令牌= XXXXXXX?
 

这个我试过,到目前为止,但没有运气。

 <意向滤光器>
        <作用机器人:名称=android.intent.action.VIEW/>

        <类机器人:名称=android.intent.category.DEFAULT/>
        <类机器人:名称=android.intent.category.BROWSABLE/>

        <数据
            机器人:主机=*
            机器人:pathPattern =* \\ * M3U8 *。
            机器人:计划=HTTP/>
    &所述; /意图滤光器>
 

我在想什么?
需要你的帮助。
这为我工作。希望它可以帮助其他的了。

 <数据机器人:计划=HTTP机器人:主机=*
            。* \\ M3U8:机器人pathPattern = />
        <数据机器人:计划=HTTP机器人:主机=*
            机器人:pathPattern =。\\ *。* \\ M3U8/>
        <数据机器人:计划=HTTP机器人:主机=*
            机器人:pathPattern =* \\ .. \\ *。* \\ .. M3U8/>
        <数据机器人:计划=HTTP机器人:主机=*
            。* \\ .. \\ *。* \\。* \\ M3U8:机器人pathPattern = />
 

解决方案

试试这个,

 <意向滤光器>
    <作用机器人:名称=android.intent.action.VIEW/>
    <类机器人:名称=android.intent.category.DEFAULT/>
    <类机器人:名称=android.intent.category.BROWSABLE/>
    <数据机器人:计划=HTTP/>
    <数据机器人:主机=*/>
    <数据机器人:MIMETYPE =* / */>
    <数据机器人:pathPattern =* * \\ M3U8。/>
&所述; /意图滤光器>
 

或者具有此

 <意向滤光器>
    <作用机器人:名称=android.intent.action.VIEW/>
    <类机器人:名称=android.intent.category.DEFAULT/>
    <类机器人:名称=android.intent.category.BROWSABLE/>
    <数据机器人:计划=HTTP/>
    <数据机器人:主机=*/>
    <数据机器人:pathPattern = />中* \\ M3U8。
&所述; /意图滤光器>
 

这工作:

 <数据机器人:计划=HTTP机器人:主机=*
            。* \\ M3U8:机器人pathPattern = />
        <数据机器人:计划=HTTP机器人:主机=*
            机器人:pathPattern =。\\ *。* \\ M3U8/>
        <数据机器人:计划=HTTP机器人:主机=*
            机器人:pathPattern =* \\ .. \\ *。* \\ .. M3U8/>
        <数据机器人:计划=HTTP机器人:主机=*
            。* \\ .. \\ *。* \\。* \\ M3U8:机器人pathPattern = />
 

I want to make intent-filter which can detect urls like this one:

http://192.168.0.xx/playlist/_definst_/iphone.smil/list.m3u8?token=XXXXXXX

I tried this so far, but no luck.

    <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:host="*"
            android:pathPattern=".*\\*.m3u8.*"
            android:scheme="http" />
    </intent-filter>

What am I missing?
Need your help.
This worked for me. Hope it helps other too.

 <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..*\\.m3u8" />

解决方案

Try with this,

<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="http" />
    <data android:host="*" />
    <data android:mimeType="*/*" />
    <data android:pathPattern="*.*\\.m3u8" />
</intent-filter>

Or, with this

<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="http" />
    <data android:host="*" />
    <data android:pathPattern=".*\\.m3u8" />
</intent-filter>

This worked:

     <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\.m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..m3u8" />
        <data android:scheme="http" android:host="*"
            android:pathPattern=".*\\..*\\..*\\..*\\.m3u8" />

这篇关于Android的意图过滤器pathPattern的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆