Private Sub SetData(Mime As String, Values As ContentValues, Id As Long, Update As Boolean)
If Update Then
cr.Update(dataUri, Values, "mimetype = ? AND contact_id = ?", Array As String(Mime, Id))
Else
Dim crsr As Cursor = cr.Query(contactUri, Array As String("name_raw_contact_id"), _
"_id = ?", Array As String(Id), "")
If crsr.RowCount = 0 Then
Log("Error getting raw_contact_id")
crsr.Close
Return
End If
crsr.Position = 0
Values.PutString("raw_contact_id", crsr.GetString("name_raw_contact_id"))
crsr.Close
Values.PutString("mimetype", Mime)
cr.Insert(dataUri, Values)
End If
End Sub