P
pnoom
Neues Mitglied
- 2
Hallo,
unter Android 1.6 lege ich einen neuen Kontakt an und möchte diesem dann Firmeninformationen (Organization) hinzufügen. Das Anlegen (inklusive mehrerer Telefonnummern und Adressen) funktioniert auch wie gewünscht, aber beim Hinzufügen der Organization bekomme ich eine UnsupportedOperationException (Unknown uri: content://contacts/people/16/organizations). Der relevante Codeteil ist:
Hat jemand eine Idee woran das liegen könnte?
unter Android 1.6 lege ich einen neuen Kontakt an und möchte diesem dann Firmeninformationen (Organization) hinzufügen. Das Anlegen (inklusive mehrerer Telefonnummern und Adressen) funktioniert auch wie gewünscht, aber beim Hinzufügen der Organization bekomme ich eine UnsupportedOperationException (Unknown uri: content://contacts/people/16/organizations). Der relevante Codeteil ist:
Code:
Uri newContact; // der neu angelegte Kontakt
String organisation = "Firmenname";
Uri newContactAppended =
Uri.withAppendedPath(
newContact,
android.provider.Contacts.Organizations.CONTENT_DIRECTORY);
ContentValues organisationValues = new ContentValues();
organisationValues.put(
android.provider.Contacts.Organizations.COMPANY,
organization);
organisationValues.put(
android.provider.Contacts.Organizations.ISPRIMARY,
1);
// XXX: hier wird die Exception geworfen
getContentResolver().insert(
newContactAppended,
organisationValues);
Hat jemand eine Idee woran das liegen könnte?
Zuletzt bearbeitet: