B4J Question Solution with assistance of MS Copilot??? ABMaterial: java.nio.channels.ClosedChannelException - how to suppress

JackKirk

Well-Known Member
Licensed User
Longtime User
Not so much a question as an (unverified) observation...

This has been really bugging me - see previous thread:
https://www.b4x.com/android/forum/t...losedchannelexception-how-to-suppress.167875/

After a lot of digging around with MS Copilot and blind "what if" shots it seems that the problem occurs in my B4J ABMaterial app when I use javascript statements of the form:

window.open(url, '_blank');
which according to Copilot means "open this URL in a separate tab and keep current page alive"

If I use:

window.location.href = url;
which according to Copilot means "leave this page and go to this URL"

the problem seems to go away

So I asked Copilot (setting it to "Deep research"):

in my b4j abmaterial app it seems that is I use window.open(url, '_blank'); I sometimes generate ClosedChannelException errors but if I use window.location.href = url; I don't - does this make sense

and it eventually responded with a very lengthy positive response:

https://copilot.microsoft.com/shares/p8vxsHroGnbkJuRs9KRyY

which is bordering on out of my competence but maybe Alain or Erel could have a look and see if it is reasonable.

Any and all inputs requested...
 
Last edited:
Top