我正在尝试使用意图插入联系人,并且我尝试了从 Android Sdk 获取的这段代码,请在此处查看:
ArrayList<ContentValues> data = new ArrayList<ContentValues>();
ContentValues row1 = new ContentValues();
row1.put(Data.MIMETYPE, Organization.CONTENT_ITEM_TYPE);
row1.put(Organization.COMPANY, "Android");
data.add(row1);
ContentValues row2 = new ContentValues();
row2.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE);
row2.put(Email.TYPE, Email.TYPE_CUSTOM);
row2.put(Email.LABEL, "Green Bot");
row2.put(Email.ADDRESS, "android@android.com");
data.add(row2);
Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
intent.putParcelableArrayListExtra(Insert.DATA, data);
startActivity(intent);
我得到一个空的 InsertContact 意图。它让我发疯,为什么它不起作用?