我认为,你可以通过在AndroidManifest.xml
文件,你有兴趣在URL模式创建intent-filter
做到这一点。对于文档intent-filter
的< data>元素展示了如何指定host
和scheme
(在你的情况下是“html”)来处理URL。
This答案显示了开发人员想要处理youtube.com网址的示例。我已经encluded清单片段下方的完整性:
<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="www.youtube.com" android:scheme="http" />
</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:host="http://X.X.X.X:8080/DocumentViewer/" android:scheme="http" />
</intent-filter>
ListView显示你的对话?如果是的话,它可能很丑,但你可以在ListView上设置一个onItemClickListener并解析消息。 –