我認爲,你可以通過在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並解析消息。 –