Default Account Type

Put your problem here if it does not fit any of the other categories.

Default Account Type

Postby Unicate » Fri Mar 04, 2011 2:05 pm

Hi everyone!

I have to write an application (>= SDK 4) which is able to create Contacts. So I started to read about that and there is something I don't understand:
I found that one on
Code: Select all
ContentValues values = new ContentValues();
values.put(RawContacts.ACCOUNT_TYPE, accountType);
values.put(RawContacts.ACCOUNT_NAME, accountName);
Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);

sounds good so far, then I was wondering what the account type itself is. I figured out that the
AccountTypes can be accessed with the AccountManager. No big deal till here.

But if I ask the AccountManager on the emulator, it does not return me anything. I created some contacts on the emulator already. What AccountType do I have to access to create a contact on the device/emulator?

Thank you in advance
Junior Developer
Junior Developer
Posts: 10
Joined: Thu Sep 02, 2010 8:23 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: MSNbot Media, Yahoo [Bot] and 17 guests