Reputation: 87
If there's a WhatsApp chat which has location shared, when clicked it shows a chooser intent with some set of applications. I want to write an intent filter so that my application will also be listed there.
Upvotes: 1
Views: 795
Reputation: 87
Add this to your Manifest file (Particular activity):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="geo" />
</intent-filter>
Upvotes: 0
Reputation: 1648
You can do it by supporting implicit intent
to your Activity
.
Define intent-filter
to Activity
to which you want to open after clicking to your Application from options.
<activity android:name=".BrowserActivitiy"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http"/>
<data android:scheme="geo"/>
</intent-filter>
</activity>
To know more about Intents and Intent filters go to official website. https://developer.android.com/guide/components/intents-filters
Upvotes: 2