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:
respond to an event (such as button clicked on a web page)
iterate through all the
INPUT
elements in a page开发者_开发百科 and retrieve their contents?Find all
DIV
elements with the classstatus
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
精彩评论