And if possible, how can I get this behavior for 'my' app?
For example, when a user navigates to the URL 'example.com/*' (any page starting with example.com), I'd want it so the 'complete this action with' menu shows up listing all of the browsers and this particular app?
I've done some reading of the Intent documentation, but it seems like you can only create them for phone data, not web URLs.
Edit: anyone? I've looked into this some more, but haven't had any luck. I'd like to set a bounty, but I don't have that option yet. If it isn't possible, I guess I'll just make a way to paste in a URL.
It's pretty simple, actually! What you want is an intent filter with the BROWSABLE category set, and a <data>
tag set up to match your URL.
Inside your <activity>
, add:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" android:host="www.example.com" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
and set up the action and categories how you want, and change the data tag values to something relevant to your application. This will allow your link (in this case, http://www.example.com/
) to be launched in your application by the browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With