mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
ignore the default and Favorites group
This commit is contained in:
parent
0b2f6e8f04
commit
dbad01e1fc
@ -341,7 +341,7 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
|||||||
groups.put(id, ArrayList())
|
groups.put(id, ArrayList())
|
||||||
}
|
}
|
||||||
|
|
||||||
val groupTitle = storedGroups.firstOrNull { it.id == newRowId }?.title ?: ""
|
val groupTitle = storedGroups.firstOrNull { it.id == newRowId }?.title ?: continue
|
||||||
val group = Group(newRowId, groupTitle)
|
val group = Group(newRowId, groupTitle)
|
||||||
groups[id]!!.add(group)
|
groups[id]!!.add(group)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
@ -363,9 +363,12 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
|||||||
ContactsContract.Groups.TITLE
|
ContactsContract.Groups.TITLE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val selection = "${ContactsContract.Groups.AUTO_ADD} = ? AND ${ContactsContract.Groups.FAVORITES} = ?"
|
||||||
|
val selectionArgs = arrayOf("0", "0")
|
||||||
|
|
||||||
var cursor: Cursor? = null
|
var cursor: Cursor? = null
|
||||||
try {
|
try {
|
||||||
cursor = activity.contentResolver.query(uri, projection, null, null, null)
|
cursor = activity.contentResolver.query(uri, projection, selection, selectionArgs, null)
|
||||||
if (cursor?.moveToFirst() == true) {
|
if (cursor?.moveToFirst() == true) {
|
||||||
do {
|
do {
|
||||||
val id = cursor.getIntValue(ContactsContract.Groups._ID)
|
val id = cursor.getIntValue(ContactsContract.Groups._ID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user