i don't think you want to get into an interactive
dialog in that sub.
since you always return true, there is no need to
hang around in the sub (especially since webview
is already waiting for you to finish hanging around).
trigger another sub (callsubdelayed) with the non-modal
dialog in it and return true from the event sub. the user's
decision is then made elsewhere, away from the event sub.
in looking at the tiny snippet you posted, not only
were you waiting for the modal dialog, but the
"do something" means that the sub could
be active even longer before returning true.
i think that's a bad move.
it looks to me like you're using the overrideurl event
for something it was not designed to handle.
for the clever hack, but you lose points by not
exiting the sub as quickly as possible.
i'm going to try to cobble something together out of
curiosity, but you might want to think about what i'm
there are other ways to get the kind of communication
you're looking for between webview and app. you picked
a tricky one, in my opinion, but i think it should work.
UPDATE: yeah, it works as i thought. so, first, there could
be errors elsewhere in your code; you only showed a very
anyway, here's what i did:
i created a sub with a msgbox2 dialog in it (use async if you
want). in overrideurl i put a log message indicating that i
was in overrideurl. i added a callsubdelayed() to the sub with
the dialog next, and then immediately followed with return true
(actually, i put return false because i wanted to see if the link
was followed before or after the dialog).
i had a webpage in a webview click on a link which, naturally,
triggers an overrideurl event in b4a. the link was followed
(meaning the sub had returned false), and then the dialog
appeared. no crash.
callsubdelayed(Me, "dialogsub") ' i hovered in the dialog. no effect on the overrideurl sub
return true ' or false this will not be delayed
dim ans as int = msgbox2( .......) ' or msgbox2async() and wait for
if ans = dialogresponse.positive then
to repeat myself, there could be some other issue in your code which causes your crash. try the above.