I am trying to open Gmail from my app ( on click of button) . I am facing issue in android 11 only . Its not opening the Gmail . queryIntentActivities is returning empty list in this case.
Please help me how to fix this issue for android 11. Below is the code which i am using ..
val pkgManager = aContext.packageManager
val packages = pkgManager.queryIntentActivities(intent, 0)
if (!packages.isEmpty()) {
for (resolveInfo in packages) {
val packageName = resolveInfo.activityInfo.packageName
aEmailClientNames.add(resolveInfo.loadLabel(aContext.packageManager).toString())
aEmailClientIcons.add(resolveInfo.loadIcon(aContext.packageManager))
aEmailClientPackageNames.add(packageName)
}