How To Programmatically Click a Web Button created by HTML that is being displayed in a WebView object by my app?
I have a simple app that browses web pages. They are displayed in WebView1. One of the html web pages displays a clickable button. It's part of the web page, not part of my app, but of course it shows up in my app because my app is displaying that web page.
A user could currently click this button by pressing it manually. Once clicked, my WebView1 window displays an updated html page.
However, what I'd LOVE to be able to do is to click that one button programmatically so that my users don't have to bother pressing that button.
Possible? Easy? Already done and my search just didn't find it?
if the button has an id you could use it with this
B4X:
Sub Globals
Dim wv As WebView
Dim wve As WebViewExtras
End Sub
Sub Activity_Create(FirstTime As Boolean)
wv.Initialize("wv")
wv.JavaScriptEnabled=True
Activity.AddView(wv,0,0,100%x,100%y)
wv.LoadUrl("http://www.google.com")
End Sub
Sub wv_PageFinished (Url As String)
wve.addWebChromeClient(wv,"")
wve.executeJavascript(wv,"alert('yo')")
End Sub
Thanks...but weirdly enough, in Release mode the web page is loading, but the "B4A" text isn't even being entered into the input box...whereas in debug mode it does get entered, just not searched.