How can I retrieve the Javascript function value from a web page loaded withing a webview component??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t, directly.
You can call the Javascript function via
loadUrl("javascript:..."), where...is your function call. However, you cannot get a result this way.If you inject a Java object into the Web page via
addJavascriptInterface(), you could set up another function that called the function you want and returns that value via a call to the injected Java object. That only works if you can modify the Web page, though.