我正在开发一个网络浏览器(来自教程),我们称之为X并且没有太多使用Android SDK的经验。
我正在尝试捕获链接并从X浏览到它。
我已从设备中删除所有浏览器并将X设置为默认浏览器,但仍然无法在X中打开Google App中的链接,Google应用会提供输出"No applications found to open this url"
。
出了什么问题,我使用<intent-filter>
将类别设置为可浏览。
除此之外,我无法理解官方文档中的缩进概念,因此即使X收到它,我也无法处理意图数据。请提供一些可能对我有帮助的资源,谷歌搜索没有找到我能理解的相关内容。
答案 0 :(得分:0)
您的意图过滤器可能没有指定在所有http和https链接上使用AC处理ACTION_VIEW。从android的开源浏览器的清单中试试这个:
<!-- For these schemes were not particular MIME type has been
supplied, we are a good candidate. -->
<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:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<!-- For these schemes where any of these particular MIME types
have been supplied, we are a good candidate. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="inline" />
<data android:mimeType="text/html"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="application/xhtml+xml"/>
<data android:mimeType="application/vnd.wap.xhtml+xml"/>
</intent-filter>