What allows Google Maps / Youtube to display the "Complete this action with" menu?

And if possible, how can I get this behavior for "my" application?

For example, when a user navigates to the URL example.com/* (any page starting with example.com), would I like the listing of all browsers and this particular application to appear in the "complete this action with" menu?

I read the Intent documentation, but it looks like you can only create them for phone data, not for websites.

Edit: who? I studied this a little more, but no luck. I would like to set up generosity, but I do not have such an option yet. If this is not possible, I think I will just make a way to insert the url.

+6
android
source share
2 answers

It's pretty simple, really! What you want is an intent filter with a set of BROWSABLE categories and a <data> tag configured to match your URL.

Inside the <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 configure the action and categories as you want, and change the values โ€‹โ€‹of the data tag to something that relates to your application. This will allow your link (in this case, http://www.example.com/ ) to be launched in your application by the browser.

+12
source share

Take a look at http://developer.android.com/guide/topics/intents/intents-filters.html#ires
It is really well described how to use intent filters and why, especially in the General Cases section ( http://developer.android.com/guide/topics/intents/intents-filters.html#ccases ).

0
source share

All Articles