Load a div into a webview on Android

后端 未结 2 997
青春惊慌失措
青春惊慌失措 2020-12-16 02:54

I have an Android app, which contains a WebView, and I would like to display in it not a webpage, but only a div from that webpage. I should mention that I do not have acces

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 03:21

    You'll need to load the HTML of the page yourself, extract the div contents and pass it to the WebView as a string. You may find an HTML parser library (e.g. tagsoup) useful for this.

提交回复
热议问题