Is there a way to define shouldOverrideUrlLoading so that I can load URL in a specific external app.
I have a web app displayed in webview and I need to load some video files externally in some other video player instead of default android media player.
Here is the current code:
private class MainWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView webview, String url) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse(url), "video/mp4");
startActivity(i);
return true;
}
}
Thanks in advance.