开发者

Android: How to interact with the contents of a WebView?

Is there a way to programmatically interact with the contents of a WebView?

For example, how could my app:

  1. respond to an event (such as button clicked on a web page)

  2. iterate through all the INPUT elements in a page开发者_开发百科 and retrieve their contents?

  3. Find all DIV elements with the class status and change their content?

Thanks!


You can use Javascript to make a callback to Java for anything that Javascript can detect.

You can see a demo call JS to Java here: Android Calling JavaScript functions in WebView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜