2

It is using packageManager.resolveActivity to check the activity when receiving FCM notification and preparing the Intent (so there is no startActivity() call directly).

It works on other os version but not on android 11, the packageManager.resolveActivity returns null:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.yahoo.com"));
 ResolveInfo info = packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);

following the https://developer.android.com/training/package-visibility/use-cases#open-urls-browser-or-other-app,

added in manifest:

<queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <!-- <data android:scheme="*" /> --> //<== with or without this line it is the same
        </intent>
    </queries>

However, it still returns null.

Any suggestion/solution?

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
lannyf
  • 9,865
  • 12
  • 70
  • 152

0 Answers0