mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Prevent crash
This commit is contained in:
parent
6b9ca94c74
commit
d69cdbb506
1 changed files with 23 additions and 15 deletions
|
@ -6472,21 +6472,29 @@ public class FragmentCompose extends FragmentBase {
|
||||||
final Spinner spGroup = dview.findViewById(R.id.spGroup);
|
final Spinner spGroup = dview.findViewById(R.id.spGroup);
|
||||||
final Spinner spTarget = dview.findViewById(R.id.spTarget);
|
final Spinner spTarget = dview.findViewById(R.id.spTarget);
|
||||||
|
|
||||||
Cursor groups = context.getContentResolver().query(
|
String[] projection = new String[]{
|
||||||
ContactsContract.Groups.CONTENT_SUMMARY_URI,
|
ContactsContract.Groups._ID,
|
||||||
new String[]{
|
ContactsContract.Groups.TITLE,
|
||||||
ContactsContract.Groups._ID,
|
ContactsContract.Groups.SUMMARY_COUNT,
|
||||||
ContactsContract.Groups.TITLE,
|
ContactsContract.Groups.ACCOUNT_NAME,
|
||||||
ContactsContract.Groups.SUMMARY_COUNT,
|
ContactsContract.Groups.ACCOUNT_TYPE,
|
||||||
ContactsContract.Groups.ACCOUNT_NAME,
|
};
|
||||||
ContactsContract.Groups.ACCOUNT_TYPE,
|
|
||||||
},
|
Cursor groups;
|
||||||
// ContactsContract.Groups.GROUP_VISIBLE + " = 1" + " AND " +
|
try {
|
||||||
ContactsContract.Groups.DELETED + " = 0" +
|
groups = context.getContentResolver().query(
|
||||||
" AND " + ContactsContract.Groups.SUMMARY_COUNT + " > 0",
|
ContactsContract.Groups.CONTENT_SUMMARY_URI,
|
||||||
null,
|
projection,
|
||||||
ContactsContract.Groups.TITLE
|
// 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(
|
SimpleCursorAdapter adapter = new SimpleCursorAdapter(
|
||||||
context,
|
context,
|
||||||
|
|
Loading…
Reference in a new issue