0

In order to prepare for Instant Apps, I split my app into multiple modules with one activity each. Each activity launches another activity by throwing an intent with the destination URL (as opposed to class name).

The issue here is that the activity chooser shows up after each startActivity call. Users can select "always" for each activity, but doing it for 25 activities, navigating within the app will be a poor experience.

I can have autoVerify=true in the Manifest. This will help API level 23+. But any ideas how to support the older versions? InstantApp is supported until SDK 21, and my regular app is on API 19.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
dev
  • 11,071
  • 22
  • 74
  • 122
  • Show us the code that creates and sends an intend and the correspondig manifest entry. Usually you get the chooser when you have more than one activity matching or if you use createChooser. – k3b Apr 09 '18 at 15:47
  • if you don't need to respond to intents from other application.. may be you can use define custom actions and use intent-filters in your manifest.. that way only your app will respond and the system won't show activity chooser – ColdFire Apr 09 '18 at 15:50

1 Answers1

0

You'll have to add the DEFAULT category to your intent filter like this:

<intent-filter android:autoVerify="true">

       <action android:name="android.intent.action.VIEW" />
       <category android:name="android.intent.category.BROWSABLE" />
       <category android:name="android.intent.category.DEFAULT" />
       ...
</intent-filter>

See this sample for more context.

Ben Weiss
  • 17,182
  • 6
  • 67
  • 87