Access data created by WebView in Activity

I have an HTML page that uses local storage to store some data. I am wondering if it is even possible to access data (generated by the web view) outside the web view, for example, from activity.

+3
source share
1 answer

You can add an object that will be accessible through javascript using WebView.addJavascriptInterface . Then call one of the methods from JavaScript, passing it the stored data. When called, you can access this data from a method called by an object added to the WebView.

+1
source

Source: https://habr.com/ru/post/1795310/


All Articles