adding a contact

derez

Expert
Licensed User
Longtime User
Is it possible to add a contact to the phone's contacts list ? phone intent is only reading it.
 

aklisiewicz

Active Member
Licensed User
Longtime User
I would like to ba able to add records to contacts to,...
implementation would be more than welcomed !

Arthur
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Thanks to optimist, but...

How to start the custom intent (with pre-selected "putExtras" fields) for adding a contact ?

Noting, for example

B4X:
Intent addContactIntent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI);
addContactIntent.putExtra(Contacts.Intents.Insert.NAME, "Jean-Claude"); // an example, there is other data available
startActivity(addContactIntent)

This try does not work :-:)

B4X:
Dim i As Intent
i.Initialize("android.intent.action.INSERT", "vnd.android.cursor.dir/contact_extensions")
StartActivity(i)

and gives "No activity found to handle intent"
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
i.Initialize("com.android.contacts.action.SHOW_OR_CREATE_CONTACT","tel:12345")

seems, is helping....
needto check.
and understand how to make pre-selected fields
 
Upvote 0
Top