Search code examples
androidandroid-intentdeep-linkingandroid-app-indexing

Launch an app when a user taps a link in an android webview


I've been looking around for for this but I cannot figure it out. I have

Java file:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url ));
startActivity(browserIntent);
return true;

where url = "facebook.com"

Or in the manifest:

<intent-filter>
    <data
         android:host="facebook.com"
        android:scheme="http" />
     <data
         android:host="www.facebook.com"
         android:scheme="http" />
</intent-filter>

Basically if the user has an app for a domain it should launch it. It's not a general way, the domains are hardcoded of corse.


Solution

  • I believe this is what you're looking for:

    Android Intents with Chrome.