Android Question Set event in class ContactUtils

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
The ContactUtils class has a GetEvents

B4X:
 'Returns a List with cuEvents items.
 Public Sub GetEvents (Id As Long) As List
       Dim res As List
       Res.Initialize
       For Each obj () As Object In GetData ("vnd.android.cursor.item / contact_event", Array As String      ("data1", "data2"), Id, Null)
           Dim and As CuEvent
           E.Initialize
           E.DateString = obj (0)
           E.EventType = eventTypes.Get (obj (1))
           Res.Add (e)
      Next
  Return res
End Sub

Does anyone know how to implement a SetEvent method in class ContactUtils?

I'm not getting.

Thank you for help.
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I got it that way. If someday someone needs:

B4X:
Public Sub SetEvents(Id As Long, EType as Int, Date As String)

'1  "anniversary"
'2  "other"
'3  "birthday"
           
    Dim v As ContentValues
    v.Initialize
    v.PutString("data1", Date)
    v.PutString("data2", EType)
    SetData("vnd.android.cursor.item/contact_event", v, Id, True)  

End Sub
 
Upvote 0
Top