Skip to content

How to retrieve contact after insert? #273

Answered by vestrel00
alorma asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @alorma, I don’t think the bug is with the library so I changed this issue into a discussion. We can create another issue if there is indeed a bug with the library.

I see that the issue is that you are creating an instance of a NewRawContact twice. The first instance you created is not passed into the insert function but is passed into the insert result.

Try this,

suspend fun createTemporalContact(temporalContact: NewTemporalContact): Boolean {

    val rawContact: NewRawContact = NewRawContact().apply {
      setName {
        displayName = temporalContact.name
      }
      addPhone {
        number = temporalContact.phone
      }
    }

    val insertResult = contacts
      .insert…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vestrel00
Comment options

@alorma
Comment options

@alorma
Comment options

Answer selected by alorma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #272 on December 11, 2022 16:44.