Home Forum
Welcome, Guest
Username Password: Remember me

Adding a contact
(1 viewing) (1) Guest
Discussion related to creating Android software
  • Page:
  • 1

TOPIC: Adding a contact

Adding a contact 2 years, 9 months ago #171

Trying to get an android application to add a contact to the contacts list, You can see a smooth example of this in the Google maps application, the contact is added and available for editing, not yet been able to provide as solution as smooth as that, the following adds a contact but the user is prompted to confirm the addition and the contact list (or a choice where to add the contact number?) is displayed not the contact details.

 
Uri newContact = Uri.fromParts("tel","000 00000 000", null);
 
Intent intent = new Intent(Contacts.Intents.SHOW_OR_CREATE_CONTACT,newContact);
 
intent.putExtra(Contacts.Intents.Insert.NAME,"Bob the contact");
 
intent.putExtra(Contacts.Intents.Insert.PHONE, "000 00000 000");
 
intent.putExtra(Contacts.Intents.Insert.POSTAL, contactAddressString);
 
startActivity(intent);
 


Anybody got a smoother solution than this?
  • marvin
  • OFFLINE
  • Professor
  • Posts: 18
  • Karma: 0
Last Edit: 2 years, 9 months ago by marvin.
  • Page:
  • 1
Time to create page: 0.21 seconds
Copyright © 2012 Android Academy. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
 
Glossary
We have 26 guests online