android磁铁链接数据过滤器
当用户在浏览器中选择磁铁链接时,我想从我的应用程序启动Android活动 根据,URI由其每个部分的单独属性指定:android磁铁链接数据过滤器,android,intentfilter,magnet-uri,Android,Intentfilter,Magnet Uri,当用户在浏览器中选择磁铁链接时,我想从我的应用程序启动Android活动 根据,URI由其每个部分的单独属性指定: scheme://host:port/path 或路径前缀或路径模式 磁铁链接的问题是它们有不同的模式,如磁铁:?xt=…… 我试过这样的东西 <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="and
scheme://host:port/path 或路径前缀或路径模式 磁铁链接的问题是它们有不同的模式,如
磁铁:?xt=……
我试过这样的东西
<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="magnet"
android:host="*"
/>
</intent-filter>
但它不起作用(当我在浏览器中打开磁铁链接时,活动没有启动)。你能帮我正确地声明磁铁链接的意图过滤器吗?我得到了这个:
<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="magnet"
/>
</intent-filter>
基本上,我删除了android:host我得到了这样的结果:
<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="magnet"
/>
</intent-filter>
基本上,我删除了android:host