I call an intent to add a contact to device like this :
Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
intent.putExtra(ContactsContract.Intents.Insert.NAME,
user.getName());
intent.putExtra(ContactsContract.Intents.Insert.IM_HANDLE,
user.getID());
intent.putExtra(
ContactsContract.Intents.Insert.IM_PROTOCOL,
ContactsContract.CommonDataKinds.Im.PROTOCOL_CUSTOM);
startActivityForResult(intent, 0);
The documentation says:
public static final String PROTOCOL
This column should be populated with one of the defined constants, e.g. PROTOCOL_YAHOO. If the value of this column is PROTOCOL_CUSTOM, the CUSTOM_PROTOCOL should contain the name of the custom protocol. Constant Value: "data5".
When I click to add or edit contact a pop-up dialog appear with empty edittext where I have to select the name of CUSTOM_PROTOCOL. According to the docs I cant find the way how to set CUSTOM_PROTOCOL value.