G
G
Good Samaritan2019-02-22 17:01:38
Android
Good Samaritan, 2019-02-22 17:01:38

how to get value from javascript in android?

Good afternoon. My application consists of a webview.
In order for the application to be at least somehow similar to the "android" one, I added a button to add to the mainactivity, when clicked, the javascript code of the site is called, which displays a pop-up window for entering information. At the same time, I do
add_button.hide () in mainactivity so that when the window pops up, the add button disappears.
Now I can't figure out how to make add_button reappear after submitting the form or closing the popup window. On the side of the site, I can write to the javascript variable on the event that the window has closed. How can I get this value in webview to do something like add_button.show() ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2019-02-22
@onepavel

There is such a class JavaScriptInterface
with its help, you can implement the logic
of calling java code from js executable in webview
implementation example https://stackoverflow.com/questions/10389572/call-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question