use of com.android.contacts.editor.ContactEditorUtils in project packages_apps_Contacts by AOKP.
the class AttachPhotoActivity method selectAccountAndCreateContact.
private void selectAccountAndCreateContact() {
// If there is no default account or the accounts have changed such that we need to
// prompt the user again, then launch the account prompt.
final ContactEditorUtils editorUtils = ContactEditorUtils.getInstance(this);
if (editorUtils.shouldShowAccountChangedNotification()) {
Intent intent = new Intent(this, ContactEditorAccountsChangedActivity.class);
startActivityForResult(intent, REQUEST_PICK_DEFAULT_ACCOUNT_FOR_NEW_CONTACT);
} else {
// Otherwise, there should be a default account. Then either create a local contact
// (if default account is null) or create a contact with the specified account.
AccountWithDataSet defaultAccount = editorUtils.getDefaultAccount();
createNewRawContact(defaultAccount);
}
}
Aggregations