0

I am stuck at an issue, I don't know if its possible or not.

I need to call a HTML page, but the page has some content being loaded via Javascript too and I need to get that also.

Is this some how possible ?

Currently I have used plain: new URL(url).openConnection() and it's not returning that.

Any Help ?

Thanks

1 Answer 1

1

To do that you'll need to host a WebView in your application. It can be hidden if you want. Call the webview loadUrl to load the content you want. Handle the WebViewClient onPageFinished so you know all of the content has loaded, and then use the javascript bridge interface (addJavascriptInterface) to pass the HTML back up to the application.

Sign up to request clarification or add additional context in comments.

2 Comments

I did that, but somehow its not working, its not going inside the interface method. I can't see any exceptions also.
Did you add the @JavascriptInterface annotation to your interface method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.