ACTION_INSERT_OR_EDIT输入了NAME

时间:2014-07-19 10:44:45

标签: android android-contacts

我使用Intent.ACTION_INSERT_OR_EDIT插入/编辑手机联系人。 但是,当用户想要插入新联系人时,我将ContactsContract.Intents.Insert.NAME置于捆绑包中。但是当用户选择编辑联系人时,也会插入名称(旧名称被重写)...是否有一些FLAG或者如何防止这种行为?

Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
                intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
                intent.putExtra(ContactsContract.Intents.Insert.NAME,
                        u.getName());
                intent.putExtra(INTENT_KEY_FINISH_ACTIVITY_ON_SAVE_COMPLETED,
                        true);
                startActivityForResult(intent, ADD_CONTACT);

0 个答案:

没有答案