How can I get entered text from Android WebView and use it in my code

2k views Asked by At

I have a WebView that has a textfield in it, in which the user enters some text. On a button press I want to extract this text from the WebView and store it in a String so that I can use it later in some other native code.

Note: This text entry must be done in a WebView, and cannot be moved to an EditText.

1

There are 1 answers

0
NSimon On

You need to get access to the function behind the button (ie the webview you're accessing has to provide it)

Basically, this post will help you accomplish what you're looking for : https://stackoverflow.com/a/9581016/4232337