2

when I click an applink,I need to chose the chrome or my app

enter image description here

I Check my website Google Statement List Generator and Tester i got below

Success! Host XXX grants app deep linking to XXX.

But adb shell dumpsys package domain-preferred-apps shows

"Status: undefined"

Anyone knows how to fix it?

Manifest.xml `

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:scheme="https"
                android:host="XXXX.XX"
                android:path="/test" />
        </intent-filter>`

the applinks status is not "always" how to make it right???

"Status: undefined"
Evan Young
  • 21
  • 2

2 Answers2

0

put this code on TextView onClick Listener..

String urlString="http://www.google.com";
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("com.android.chrome");
try {
context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
// Chrome browser presumably not installed so allow user to choose instead
intent.setPackage(null);
context.startActivity(intent);

}

coder_baba
  • 447
  • 3
  • 21
0

To avoid seeing the chooser, you need to set up Verified App Links. See here for instructions

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44