1. Are you ready for the Galaxy S20? Here is everything we know so far!

How can i show a prefilled contacts screen on android 2.3?

Discussion in 'Introductions' started by star007, Dec 27, 2011.

  1. star007

    star007 Lurker
    Thread Starter

    Hi All,
    I know the code below opens the native Edit/Add contact screen

    Intent newIntent = new Intent(Intent.ACTION_INSERT,
    ContactsContract.Contacts.CONTENT_URI);
    startActivityForResult(newIntent, 1);

    now i want this screen to be populated with some data in fields like
    name, phone number, address etc. I found that if i do something like
    newIntent.putExtra(ContactsContract.Intents.Insert .NAME, "Some
    Name");
    will show this screen with name "Some Name" being shown in the name
    field this is fine for me now i dont understand how will i fill the
    first name, last name , city, state and zip fields similarly.
    I found the ContactsContract.Intents.Insert has a
    POSTAL attribute for address but there are no specific attributes for
    first name, last name, city, state and zip in ContactsContract.Intents.Insert.
    Also i found that
    ContactsContract.CommonDataKinds.StructuredPostal has the first name, last name, city, state
    and zip attributes but still i dont know how can i use this to
    prepopulate the Edit/Add contact screen with values of first name, last name, city, state
    and zip.

    Please Help me with this,
    star
     



    1. Download the Forums for Android™ app!


      Download

       
  2. lunatic59

    lunatic59 Moderati ergo sum
    Moderator

    Hello and welcome to Android Forums, Star! :)

    Since this is the intro forum for new members, I would recommend asking that type of question in the forums where the experienced developers hang out. You might try Application Development - Android Forums for starters. I'm sure somebody there will be able to help you. :D
     
Loading...
Similar Threads - show prefilled contacts
  1. Andrej43
    Replies:
    0
    Views:
    246
  2. alexhob123
    Replies:
    13
    Views:
    626
  3. alexhob123
    Replies:
    8
    Views:
    685
  4. fzg
    Replies:
    3
    Views:
    709
  5. MTNSteveR
    Replies:
    2
    Views:
    1,168
  6. lynxstch
    Replies:
    4
    Views:
    990
  7. King Mustard
    Replies:
    2
    Views:
    1,402
  8. ang3l1983
    Replies:
    1
    Views:
    481
  9. kite
    Replies:
    4
    Views:
    690
  10. lthygesen
    Replies:
    7
    Views:
    1,173

Share This Page

Loading...