allow selecting under which account should the contact group be created

This commit is contained in:
tibbi
2018-03-21 10:41:09 +01:00
parent d673a0124b
commit ac058c4e7b
12 changed files with 40 additions and 5 deletions

View File

@ -393,11 +393,13 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
return groups
}
fun createNewGroup(title: String): Group? {
fun createNewGroup(title: String, accountName: String, accountType: String): Group? {
val operations = ArrayList<ContentProviderOperation>()
ContentProviderOperation.newInsert(ContactsContract.Groups.CONTENT_URI).apply {
withValue(ContactsContract.Groups.TITLE, title)
withValue(ContactsContract.Groups.GROUP_VISIBLE, 1)
withValue(ContactsContract.Groups.ACCOUNT_NAME, accountName)
withValue(ContactsContract.Groups.ACCOUNT_TYPE, accountType)
operations.add(build())
}