prashant
prashant

Reputation: 3608

Access data created by WebView in the Activity

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

Upvotes: 3

Views: 555

Answers (1)

Gallal
Gallal

Reputation: 4262

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

Upvotes: 1

Related Questions