Android Question WebView_LongClick not responding while some URLs load

nikolaus

Member
Licensed User
Longtime User
Hi,

on both ICS and KK WebView doesn't respond to _LongClick as long as some websites are loading. This allways happens with play.google.com, sometimes with sueddeutsche.de if there are large adds or dynamic elements and never with purely text-based sites.

I tried:

WebView_LongClick
log("LongClick")
panelXYZ.Visible = True

and definitely Webview doesn't respond to the event until the page has loaded up to a certain point. Seems like some scripts on websites are blocking WebView events during loading or execution.

I tried to use Activity_LongClick instead but that doesn't work since WebView consumes the click :(
A transparent panel above the WebView didn't help either. It handles _LongClick well but pass-through of touch and click doesn't work reliable.

Any way to force event-handling on WebView no matter what content is loading or beeing displayed?

Thx
Nikolaus
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Any view has any event that exists
It is more correct to say that all views have the events of their parent views as well.

However there is a reason for the events to be hidden. In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks.
 
Upvote 0

nikolaus

Member
Licensed User
Longtime User
However there is a reason for the events to be hidden.

This is why I was asking if it is safe to use those hidden events.

In this case it seems like WebView is internally consuming the event (as it should). You can probably inject JavaScript code that will catch all the document clicks.

I considered that. However since WebView seems to be only consuming the event during load/execution of some kind of scripts ( and I don't know which) JavaScript injection might be unreliable and/or unpredictable. I will never know if there is a script on some website that interferes with my scripts and every new version of WebView might behave different.

If there is no method to enforce event-handling independently of what WebView is loading or displaying it does not make sense to use that event. I will implement my ideas another way.
 
Upvote 0
Top