0

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.

Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
  • 1
    That is called **deep linking** which allows a link to open the app if it's installed. Refer to this doc to enable deep linking in your app https://developer.android.com/training/app-indexing/deep-linking.html – Apurva Sep 05 '16 at 16:28

1 Answers1

0

I believe this is what you're looking for:

Android Intents with Chrome.

Yash Sampat
  • 30,051
  • 12
  • 94
  • 120