Workaround contact picker issue Android 11

pull/182/head
M66B 4 years ago
parent 42b14b4f20
commit c7f122f315

@ -63,6 +63,11 @@
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
<intent>
<action android:name="android.intent.action.PICK" />
<data android:scheme="content" />
</intent>
<intent>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.OPENABLE" />

@ -440,7 +440,8 @@ public class FragmentCompose extends FragmentBase {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
PackageManager pm = getContext().getPackageManager();
if (pick.resolveActivity(pm) == null) // system whitelisted
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), request);

Loading…
Cancel
Save