M66B 4 years ago
parent db6b2410c9
commit d62a367a6e

@ -3285,7 +3285,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onPickContact(String name, String email) { private void onPickContact(String name, String email) {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
if (pick.resolveActivity(context.getPackageManager()) == null) // system whitelisted if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(context.getPackageManager()) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show(); Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
else { else {
properties.setValue("name", name); properties.setValue("name", name);

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

@ -27,6 +27,7 @@ import android.content.pm.PackageManager;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Color; import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.provider.ContactsContract; import android.provider.ContactsContract;
@ -265,7 +266,8 @@ public class FragmentRule extends FragmentBase {
public void onClick(View v) { public void onClick(View v) {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI); Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
PackageManager pm = getContext().getPackageManager(); 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(); Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
else else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_SENDER); startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_SENDER);
@ -286,7 +288,8 @@ public class FragmentRule extends FragmentBase {
public void onClick(View v) { public void onClick(View v) {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI); Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
PackageManager pm = getContext().getPackageManager(); 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(); Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
else else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_RECIPIENT); startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_RECIPIENT);

Loading…
Cancel
Save