In Android-WebView, I am trying to open the selected/touched link in external app by overriding shouldOverrideUrlLoading.
Window beforeunload event is triggered, regardless of return value of shouldOverrideUrlLoading.
My site according to current implementation is considering ("beforeunload event") as user navigating away from the page and marking the user as inactive, which is not correct.
Want to understand the behaviour of WebView, so that I can handle correctly.
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request)
{
if (request.getUrl().getHost().contains("mysite.com"))
{
// same site load in WebView itself.
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());
startActivity(intent);
return true;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…