List of usage examples for android.content Intent ACTION_INSERT
String ACTION_INSERT
To view the source code for android.content Intent ACTION_INSERT.
Click Source Link
From source file:edu.cmu.cylab.starslinger.view.HomeActivity.java
private void showAddContact(String name) { Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType(ContactsContract.Contacts.CONTENT_TYPE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { // TODO: determine if still works on 4.4.2 android devices // Fix for 4.0.3 intent.putExtra("finishActivityOnSaveCompleted", true); }/*w w w . j ava 2s .co m*/ if (!TextUtils.isEmpty(name)) { intent.putExtra(ContactsContract.Intents.Insert.NAME, name); } boolean actionAvailable = getPackageManager().resolveActivity(intent, 0) != null; if (actionAvailable) { startActivityForResult(intent, RESULT_PICK_CONTACT_SENDER); } else { showNote(SafeSlinger.getUnsupportedFeatureString("Insert Contact")); } }