Android Question ContactsUtils Custom Fields

Discussion in 'Android Questions' started by walterf25, Apr 10, 2018.

  1. walterf25

    walterf25 Well-Known Member Licensed User

    Hello everyone, does any one know how to create custom fields with this class, i have a list of contacts i need to download from an online service which dumps the data in CSV format, i have all this part figured out, but i need to add all this information to the device's contacts, i need to add 3 custom fields Player 1, Player 2, and Player 3, is there a way to create, i've tried to write a function copying the code to add Notes from the class but it doesn't seem to work.

    Code:
    'Adds a player name to the custom field Player
    Public Sub AddPlayer(Id As Long, player As String)
        
    Dim v As ContentValues
        v.Initialize
        v.PutString(
    "data1", player)
        SetData(
    "vnd.android.cursor.item/player", v, IdTrue)
    End Sub
    Thanks in advanced for the help.

    Regards,
    Walter
     
  2. DonManfred

    DonManfred Expert Licensed User

    Maybe this helps: https://github.com/dkostyrev/SampleContacts

    ETA: I also found this info
     
  3. walterf25

    walterf25 Well-Known Member Licensed User

    I'm looking for a quick solution, i'm not really in a mood to wrap a complete different library just to add this functionality to my app.

    But thanks for the link though :D

    Walter
     
  4. BillMeyer

    BillMeyer Active Member Licensed User

  5. walterf25

    walterf25 Well-Known Member Licensed User

  6. Erel

    Erel Administrator Staff Member Licensed User

    How do you see that your code doesn't work? The field you add will not appear in the contacts app. You should however be able to fetch it.
     
    walterf25 likes this.
  7. walterf25

    walterf25 Well-Known Member Licensed User

    Hi Erel, you might be right, if that is the case, why won't the field appear in my contacts? and is there a way to make it show up?

    Thanks,
    Walter
     
  8. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice