0

I want to inject html into the same Android webview more than once. First call to inject some javascript, and second call to inject html and more javascript. In my attempts so far the second injection overwrites the first one. So I'm wondering if this is at all possible?

Vas
  • 2,014
  • 3
  • 22
  • 38
  • You can call javascript anytime using `loadurl("your javascript code here");` and to add more html, you will have to call a javascript function only to add it in some class or div, if you `loadurl("html");` then it will anyway overwrite your previous html. – Darpan Dec 29 '14 at 12:31
  • What do you mean I will have to call a javascript function only? – Vas Dec 29 '14 at 15:13

1 Answers1

0

You can get html from WebView and then update like you want. In this case you dodn't lose any information from WebView.

See:

Is it possible to get the HTML code from WebView

how to get html content from a webview?

Community
  • 1
  • 1
QArea
  • 4,955
  • 1
  • 12
  • 22
  • 1
    So you're suggesting get html from the webview, update it however I need and inject it back? – Vas Dec 29 '14 at 15:14