Custom fields for a new contact

new contact

This is the "Add New Contact" window. Is it possible to create custom data fields in this window?

My current user fields are visible only in the Contact Information window.

+4
source share
2 answers

You can start a new operation to add a new contact when the user clicks the add new contact button. To do this, you will need to create your own activity and setContentView(R.layout.YOUR_CUSTOM_ACTIVITY_SCREEN) . Now the next step is important. Add the following lines to the ManifestFile of your application:

 <activity android:name=".YOUR_CUSTOM_ACTIVITY" > <intent-filter> <action android:name="android.intent.action.INSERT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/contact"/> </intent-filter> </activity> 

Now, when the user clicks to add a new contact, he will be shown 2 options. One of them will be your application, and the other will be the default activity for adding a contact.

Hope this answer helps.

+1
source

It seems that this is the only way to do this in order to catch the intent and show that you are your own contact editing activities (at least with Android 2.1 and 2.3). I've been trying to make BroadcastReceiver workable all day. but i never succeeded.

source: https://groups.google.com/forum/?fromgroups#!topic/android-developers/bKpXE1kn4kI and Custom accountType "edit contact" and "add contact" only the name is displayed

+1
source

All Articles