How do you invoke another app from a child browser

39 Views Asked by At

We have an app with an advertising SDK. The click through url has been configured to open in a child browser. The issue arises if the click through url is a redirection to deeplink into another installed application or a redirection to the Playstore. How should we fix this?

1

There are 1 best solutions below

1
On
webView.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.startsWith("foo://")) {
            Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(launchIntent);
            return true;
        }
        return false;
    }
});