8

From Android 11 there is a change in App visibility. In my application, I need to navigate to mail apps and navigation apps.

The below code needs to be added in manifest

<manifest package="com.example.game">
    <queries>
        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="image/jpeg" />
        </intent>
    </queries>
    ...
</manifest>

According to the documentation the above example allows your app to see installed apps that support JPEG image sharing:

https://developer.android.com/training/basics/intents/package-visibility#intent-signature

Could anyone please help what "action" and "data" I need to use for navigation app (google navigation,uber) and mail apps(like outllok,gmail)?

Thanks in advance!

blueeyes
  • 143
  • 1
  • 4

3 Answers3

10

You should use "geo" scheme for queries intent in your AndroidManifest.xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example">

    ...

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="geo" />
        </intent>
    </queries>

</manifest>
okarakose
  • 3,692
  • 5
  • 24
  • 44
  • I was using "geo:" URLs and they were not working on Android 11+. Adding the above snippet to my app's manifest fixed it, thanks! – Pēteris Caune Nov 03 '21 at 08:02
8

I found my app not working after the Android 11 upgrade which was frustrating and there seemed to be gaps in the release notes to do with the intent queries.

The following code can be used for email as i used a SENDTO intent however if you used a SEND intent, change it to be that.

<queries>
    <intent>
        <action android:name="android.intent.action.SENDTO" />
        <data android:scheme="mailto" />
    </intent>
</queries>
RunningMan
  • 91
  • 5
5

Adding this intent under queries in manifest worked for me

<intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="google.navigation" />
</intent>
Magnus G
  • 111
  • 4