Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access html elements contained inside a webview?

I'm building a text editor in android for my project.I have used the opensource project TinyMCE, made some tweaks to it and integrated to my WebView ...

There is one submit button in the HTML file that i have loaded into the WebView ...

I want to know how to capture its "onClick" event so that i can write java code to save the data,that has been entered so far into the editor, in the SD card ,whenever the submit button is pressed ...

Thanks

like image 972
Surya KLSV Avatar asked May 29 '12 20:05

Surya KLSV


1 Answers

You cannot directly acces the DOM from Java (to my knowledge), but you can use JS to call Java functions with variables and pass the data in using that. You can read more about how to bind Java to JS in Android (with a sample) from the docs.

like image 55
zatatatata Avatar answered Sep 28 '22 04:09

zatatatata