I know this is an old question, but here is my solution which seemed to work for me, just in case someone has the same problem.
I was using Xamarin for Android but the Java code is pretty much the same.
For API 23+, use the ExtraAccount field EG:
Android.Accounts.Account account = new Android.Accounts.Account(accountName, accountType);
...
intent.PutExtra(ContactsContract.Intents.Insert.ExtraAccount, account);
...
And for older APIs I used the field "com.android.contacts.extra.ACCOUNT" EG:
Android.Accounts.Account account = new Android.Accounts.Account(accountName, accountType);
...
intent.PutExtra("com.android.contacts.extra.ACCOUNT", account);
...
This opened the contact intent, defaulting to the passed in account (by-passing any phone defaults). This was handy because I was setting a whole bunch of information like url, job title etc and it was getting lost because the contact intent was defaulting to SIM card - which can not hold this data!
In case your are wondering how to get the accounts on the phone, you can use:
AccountManager.Get(context).GetAccountsByType("com.google");
to get google accounts, or
AccountManager.Get(context).GetAccounts();
to get all accounts. However neither include the phone account or SIM account, so I used this code to get these:
using Android.Accounts;
...
public List<Account> GetAccounts()
{
if (CheckReadContactsPermission())
{
var accountList = new List<Account>();
var uri = ContactsContract.Settings.ContentUri;
string[] projection = { ContactsContract.Settings.InterfaceConsts.AccountName,
ContactsContract.Settings.InterfaceConsts.AccountType };
var loader = new CursorLoader(context, uri, projection, null, null, null);
var cursor = (ICursor)loader.LoadInBackground();
if (cursor.MoveToFirst())
{
do
{
accountList.Add(new Account(cursor.GetString(cursor.GetColumnIndex(projection[0])),
cursor.GetString(cursor.GetColumnIndex(projection[1]))));
} while (cursor.MoveToNext());
}
return accountList;
}
return null;
}