1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Prevent crash

This commit is contained in:
M66B 2021-09-28 21:02:48 +02:00
parent 6b9ca94c74
commit d69cdbb506

View file

@ -6472,21 +6472,29 @@ public class FragmentCompose extends FragmentBase {
final Spinner spGroup = dview.findViewById(R.id.spGroup);
final Spinner spTarget = dview.findViewById(R.id.spTarget);
Cursor groups = context.getContentResolver().query(
ContactsContract.Groups.CONTENT_SUMMARY_URI,
new String[]{
String[] projection = new String[]{
ContactsContract.Groups._ID,
ContactsContract.Groups.TITLE,
ContactsContract.Groups.SUMMARY_COUNT,
ContactsContract.Groups.ACCOUNT_NAME,
ContactsContract.Groups.ACCOUNT_TYPE,
},
};
Cursor groups;
try {
groups = context.getContentResolver().query(
ContactsContract.Groups.CONTENT_SUMMARY_URI,
projection,
// ContactsContract.Groups.GROUP_VISIBLE + " = 1" + " AND " +
ContactsContract.Groups.DELETED + " = 0" +
" AND " + ContactsContract.Groups.SUMMARY_COUNT + " > 0",
null,
ContactsContract.Groups.TITLE
);
} catch (SecurityException ex) {
Log.w(ex);
groups = new MatrixCursor(projection);
}
SimpleCursorAdapter adapter = new SimpleCursorAdapter(
context,