0

Chrome on Android support a special intent:// URL that contains both the Android intent, but also exactly the package that is intended to handle the intent. If the package is not installed it redirects to Google Play (see https://developer.chrome.com/multidevice/android/intents).

How can I accomplish the same thing in my own app, opening an intent using a specific application (avoiding the app selection dialog if multiple apps handle the intent)? I do not just want to open the other app, I also want it to handle the intent and view a specific page.

To be clear, I want the behavior to be identical to opening an Intent created by a URI, with the only difference that only a particular app should handle the intent, with no dialog asking the user to pick one if multiple apps are installed that handles it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
SoftMemes
  • 5,602
  • 4
  • 32
  • 61
  • Set the parameters of the explicit Intent to specify what you want the receiving app to do, just as you would for an implicit Intent. – Chris Stratton Jul 10 '14 at 17:42
  • Setting an URI on the intent created by getActivity().getPackageManager().getLaunchIntentForPackage(packageName) does not trigger the correct behavior. – SoftMemes Jul 10 '14 at 17:55
  • 1
    Explain **exactly** what the correct behavior is. If the desired target of your explicit Intent is not the main launcher activity, then **obviously** you would have to specify the desired target activity in your Intent (Note there are many answers at the linked duplicate beyond the one you seem to be quoting). Further, you need to set the action appropriately to your desired behavior. See again the first comment here: the only difference should be that you specify the target; every other aspect of the Intent should be the same as you were previously using. – Chris Stratton Jul 10 '14 at 20:36

0 Answers0