Monday, February 25, 2013

[android-developers] specify account for ContactsContract editor

From my app, I want to invoke the Contacts editor to allow the user to add a new contact. I want to find a way for the app to pass to the editor an account to be used. How can this be done?

I have not found any documentation on how to do this. I did find some code on github which shows a contact editor retrieving account info (see ContactEditorActivity). It calls

  getParcelable(Intents.Insert.ACCOUNT);
 
I think this must be deprecated code though, as I can't find the value Intents.Insert.ACCOUNT anywhere in the references.
 
Overall, my code for invoking the editor is working; here's an extract:
 
  Intent intent = new Intent();    intent.setAction (Intent.ACTION_INSERT);    intent.setData (ContactsContract.Contacts.CONTENT_URI);    intent.putExtra (ContactsContract.Intents.Insert.NAME, name);    ... "put" other values ...    startActivityForResult (intent, ACTIVITY_REQUEST_FULL_EDIT);
 
Thanks.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment