diff --git a/src/com/android/contacts/activities/CompactContactEditorActivity.java b/src/com/android/contacts/activities/CompactContactEditorActivity.java
index 8755863..c1c6c40 100644
--- a/src/com/android/contacts/activities/CompactContactEditorActivity.java
+++ b/src/com/android/contacts/activities/CompactContactEditorActivity.java
@@ -42,4 +42,11 @@
         final Uri uri = Intent.ACTION_EDIT.equals(action) ? getIntent().getData() : null;
         mFragment.load(action, uri, getIntent().getExtras());
     }
+
+    @Override
+    public void onBackPressed() {
+        if (mFragment != null) {
+            mFragment.save(ContactEditor.SaveMode.CLOSE);
+        }
+    }
 }
diff --git a/src/com/android/contacts/activities/ContactEditorActivity.java b/src/com/android/contacts/activities/ContactEditorActivity.java
index 16dd9a1..a0732aa 100644
--- a/src/com/android/contacts/activities/ContactEditorActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorActivity.java
@@ -45,4 +45,11 @@
                 || Intent.ACTION_EDIT.equals(action) ? getIntent().getData() : null;
         mFragment.load(action, uri, getIntent().getExtras());
     }
+
+    @Override
+    public void onBackPressed() {
+        if (mFragment != null) {
+            mFragment.save(ContactEditor.SaveMode.COMPACT);
+        }
+    }
 }
diff --git a/src/com/android/contacts/activities/ContactEditorBaseActivity.java b/src/com/android/contacts/activities/ContactEditorBaseActivity.java
index 0e46a81..3e05513 100644
--- a/src/com/android/contacts/activities/ContactEditorBaseActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorBaseActivity.java
@@ -25,6 +25,7 @@
 import com.android.contacts.common.util.ImplicitIntentsUtil;
 import com.android.contacts.editor.ContactEditorBaseFragment;
 import com.android.contacts.editor.ContactEditorFragment;
+import com.android.contacts.editor.EditorIntents;
 import com.android.contacts.interactions.ContactDeletionInteraction;
 import com.android.contacts.util.DialogManager;
 
@@ -95,9 +96,9 @@
             public static final int JOIN = 3;
 
             /**
-             * Navigate to Contacts Home activity after saving.
+             * Navigate to the compact editor view after saving.
              */
-            public static final int HOME = 4;
+            public static final int COMPACT = 4;
         }
 
         /**
@@ -258,13 +259,6 @@
         return null;
     }
 
-    @Override
-    public void onBackPressed() {
-        if (mFragment != null) {
-            mFragment.save(ContactEditor.SaveMode.CLOSE);
-        }
-    }
-
     protected final ContactEditorBaseFragment.Listener  mFragmentListener =
             new ContactEditorBaseFragment.Listener() {
 
@@ -302,16 +296,8 @@
         @Override
         public void onEditOtherContactRequested(
                 Uri contactLookupUri, ArrayList<ContentValues> values) {
-            Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
-            intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
-                    | Intent.FLAG_ACTIVITY_FORWARD_RESULT);
-            intent.putExtra(ContactEditorFragment.INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY, "");
-
-            // Pass on all the data that has been entered so far
-            if (values != null && values.size() != 0) {
-                intent.putParcelableArrayListExtra(ContactsContract.Intents.Insert.DATA, values);
-            }
-
+            final Intent intent = EditorIntents.createEditOtherContactIntent(
+                    contactLookupUri, values);
             ImplicitIntentsUtil.startActivityInApp(ContactEditorBaseActivity.this, intent);
             finish();
         }
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 4770909..64d7843 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -56,6 +56,7 @@
 import com.android.contacts.common.ContactsUtils;
 import com.android.contacts.common.dialog.ClearFrequentsDialog;
 import com.android.contacts.common.util.ImplicitIntentsUtil;
+import com.android.contacts.editor.EditorIntents;
 import com.android.contacts.interactions.ContactDeletionInteraction;
 import com.android.contacts.common.interactions.ImportExportDialogFragment;
 import com.android.contacts.common.list.ContactEntryListFragment;
@@ -959,7 +960,7 @@
         @Override
         public void onCreateNewContactAction() {
             ImplicitIntentsUtil.startActivityInApp(PeopleActivity.this,
-                    new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI));
+                    EditorIntents.createCompactInsertContactIntent());
         }
 
         @Override
diff --git a/src/com/android/contacts/editor/CompactContactEditorFragment.java b/src/com/android/contacts/editor/CompactContactEditorFragment.java
index 8af3d13..108cab6 100644
--- a/src/com/android/contacts/editor/CompactContactEditorFragment.java
+++ b/src/com/android/contacts/editor/CompactContactEditorFragment.java
@@ -31,14 +31,11 @@
 import com.android.contacts.util.ContactPhotoUtils;
 
 import android.app.Activity;
-import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.net.Uri;
 import android.os.Bundle;
-import android.provider.ContactsContract;
-import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -48,7 +45,6 @@
 import android.widget.LinearLayout;
 
 import java.io.FileNotFoundException;
-import java.util.ArrayList;
 
 /**
  * Contact editor with only the most important fields displayed initially.
@@ -185,6 +181,16 @@
     }
 
     @Override
+    public void onStop() {
+        super.onStop();
+
+        // If anything was left unsaved, save it now
+        if (!getActivity().isChangingConfigurations() && mStatus == Status.EDITING) {
+            save(SaveMode.RELOAD);
+        }
+    }
+
+    @Override
     public void onPrepareOptionsMenu(Menu menu) {
         super.onPrepareOptionsMenu(menu);
         menu.findItem(R.id.menu_change_photo).setVisible(true);
@@ -339,38 +345,11 @@
     @Override
     public void onExpandEditor() {
         // Determine if this is an insert (new contact) or edit
-        final String action = getActivity().getIntent().getAction();
-        final boolean isInsert = Intent.ACTION_INSERT.equals(action)
-                || ContactEditorBaseActivity.ACTION_INSERT.equals(action);
-
-        // Prepare an Intent to start the expanded editor
-        final Intent intent = isInsert
-                ? new Intent(ContactEditorBaseActivity.ACTION_INSERT,
-                        ContactsContract.Contacts.CONTENT_URI)
-                : new Intent(ContactEditorBaseActivity.ACTION_EDIT, mLookupUri);
-        intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
-                | Intent.FLAG_ACTIVITY_FORWARD_RESULT);
+        final boolean isInsert = isInsert(getActivity().getIntent());
 
         if (isInsert) {
             // For inserts, prevent any changes from being saved when the base fragment is destroyed
             mStatus = Status.CLOSING;
-
-            // Pass on all the data that has been entered so far
-            ArrayList<ContentValues> contentValues = mState.get(0).getContentValues();
-            if (contentValues != null && contentValues.size() != 0) {
-                intent.putParcelableArrayListExtra(
-                        ContactsContract.Intents.Insert.DATA, contentValues);
-            }
-            // Name must be passed separately since it is skipped in RawContactModifier.parseValues
-            final StructuredNameEditorView structuredNameEditorView =
-                    getContent().getStructuredNameEditorView();
-            if (structuredNameEditorView != null) {
-                final String displayName = structuredNameEditorView.getDisplayName();
-                if (!TextUtils.isEmpty(displayName)) {
-                    intent.putExtra(ContactsContract.Intents.Insert.NAME, displayName);
-                }
-            }
-            getActivity().finish();
         } else {
             // Prevent a Toast from being displayed as we transition to the full editor
             mShowToastAfterSave = false;
@@ -379,7 +358,16 @@
             save(SaveMode.RELOAD);
         }
 
+        // Prepare an Intent to start the expanded editor
+        final Intent intent = isInsert
+                ? EditorIntents.createInsertContactIntent(mState, getDisplayName())
+                : EditorIntents.createEditContactIntent(mLookupUri);
         ImplicitIntentsUtil.startActivityInApp(getActivity(), intent);
+
+        final Activity activity = getActivity();
+        if (activity != null) {
+            activity.finish();
+        }
     }
 
     @Override
@@ -393,6 +381,19 @@
         }
     }
 
+    @Override
+    public MaterialColorMapUtils.MaterialPalette getMaterialPalette() {
+        return mMaterialPalette;
+    }
+
+    @Override
+    public String getDisplayName() {
+        final StructuredNameEditorView structuredNameEditorView =
+                getContent().getStructuredNameEditorView();
+        return structuredNameEditorView == null
+                ? null : structuredNameEditorView.getDisplayName();
+    }
+
     private CompactRawContactsEditorView getContent() {
         return (CompactRawContactsEditorView) mContent;
     }
diff --git a/src/com/android/contacts/editor/ContactEditorBaseFragment.java b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
index 09408ec..584ef6f 100644
--- a/src/com/android/contacts/editor/ContactEditorBaseFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorBaseFragment.java
@@ -36,6 +36,7 @@
 import com.android.contacts.common.model.account.AccountType;
 import com.android.contacts.common.model.account.AccountWithDataSet;
 import com.android.contacts.common.util.ImplicitIntentsUtil;
+import com.android.contacts.common.util.MaterialColorMapUtils;
 import com.android.contacts.editor.AggregationSuggestionEngine.Suggestion;
 import com.android.contacts.list.UiIntentActions;
 import com.android.contacts.quickcontact.QuickContactActivity;
@@ -588,11 +589,6 @@
         super.onStop();
 
         UiClosables.closeQuietly(mAggregationSuggestionPopup);
-
-        // If anything was left unsaved, save it now but keep the editor open.
-        if (!getActivity().isChangingConfigurations() && mStatus == Status.EDITING) {
-            save(SaveMode.RELOAD);
-        }
     }
 
     @Override
@@ -863,7 +859,8 @@
         }
 
         // If we are about to close the editor - there is no need to refresh the data
-        if (saveMode == SaveMode.CLOSE || saveMode == SaveMode.SPLIT) {
+        if (saveMode == SaveMode.CLOSE || saveMode == SaveMode.COMPACT
+                || saveMode == SaveMode.SPLIT) {
             getLoaderManager().destroyLoader(LOADER_DATA);
         }
 
@@ -885,6 +882,16 @@
         // Store account as default account, only if this is a new contact
         saveDefaultAccountIfNecessary();
 
+        if (isInsert(getActivity().getIntent())
+                && saveMode == SaveMode.COMPACT && mListener != null) {
+            // If we're coming back from the fully expanded editor and this is an insert, just
+            // pass any values entered by the user back to the compact editor without doing a save
+            final Intent resultIntent = EditorIntents.createCompactInsertContactIntent(
+                    getMaterialPalette(), mState, getDisplayName());
+            mListener.onSaveFinished(resultIntent);
+            return true;
+        }
+        // Otherwise this is an edit or a back press on the compact editor so do an actual save
         return doSaveAction(saveMode);
     }
 
@@ -925,6 +932,16 @@
         return mEnabled;
     }
 
+    /**
+     * Returns the palette extra that was passed in.
+     */
+    abstract protected MaterialColorMapUtils.MaterialPalette getMaterialPalette();
+
+    /**
+     * Returns the currently displayed displayName;
+     */
+    abstract protected String getDisplayName();
+
     //
     // Account creation
     //
@@ -1077,6 +1094,10 @@
             RawContactDelta oldState, AccountType oldAccountType) {
         mStatus = Status.EDITING;
         mState.add(createNewRawContactDelta(account, accountType, oldState, oldAccountType));
+        // We bind field values that may be present on inserts (as well as edits) since
+        // the caller may want certain fields pre-populated or we may be returning to
+        // the compact editor from the fully expanded one.
+        setIntentExtras(mIntentExtras);
         mRequestFocus = true;
         mNewContactDataReady = true;
         bindEditors();
@@ -1278,13 +1299,25 @@
         }
         switch (saveMode) {
             case SaveMode.CLOSE:
-            case SaveMode.HOME:
+            case SaveMode.COMPACT:
                 final Intent resultIntent;
                 if (saveSucceeded && contactLookupUri != null) {
                     final Uri lookupUri = maybeConvertToLegacyLookupUri(
                             mContext, contactLookupUri, mLookupUri);
-                    resultIntent = ImplicitIntentsUtil.composeQuickContactIntent(lookupUri,
-                            QuickContactActivity.MODE_FULLY_EXPANDED);
+                    if (saveMode == SaveMode.CLOSE) {
+                        resultIntent = ImplicitIntentsUtil.composeQuickContactIntent(lookupUri,
+                                QuickContactActivity.MODE_FULLY_EXPANDED);
+                    } else if (saveMode == SaveMode.COMPACT) {
+                        if (isInsert(getActivity().getIntent())) {
+                            resultIntent = EditorIntents.createCompactInsertContactIntent(
+                                    getMaterialPalette(), mState, getDisplayName());
+                        } else {
+                            resultIntent = EditorIntents.createCompactEditContactIntent(
+                                    lookupUri, getMaterialPalette());
+                        }
+                    } else {
+                        resultIntent = null;
+                    }
                 } else {
                     resultIntent = null;
                 }
@@ -1538,4 +1571,14 @@
         // Otherwise pass back a lookup-style Uri
         return contactLookupUri;
     }
+
+    /**
+     * Whether the argument Intent requested a contact insert action or not.
+     */
+    protected static boolean isInsert(Intent intent) {
+        if (intent == null) return false;
+        final String action = intent.getAction();
+        return Intent.ACTION_INSERT.equals(action)
+                || ContactEditorBaseActivity.ACTION_INSERT.equals(action);
+    }
 }
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 9e5148d..89b4bf8 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -28,6 +28,7 @@
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
+import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
@@ -45,6 +46,7 @@
 import com.android.contacts.common.model.account.AccountWithDataSet;
 import com.android.contacts.common.util.AccountsListAdapter;
 import com.android.contacts.common.util.AccountsListAdapter.AccountListFilter;
+import com.android.contacts.common.util.MaterialColorMapUtils;
 import com.android.contacts.detail.PhotoSelectionHandler;
 import com.android.contacts.editor.Editor.EditorListener;
 import com.android.contacts.util.ContactPhotoUtils;
@@ -117,11 +119,30 @@
     }
 
     @Override
+    public void onStop() {
+        super.onStop();
+
+        // If anything was left unsaved, save it now and return to the compact editor.
+        if (!getActivity().isChangingConfigurations() && mStatus == Status.EDITING) {
+            save(SaveMode.COMPACT);
+        }
+    }
+
+    @Override
     public void onExternalEditorRequest(AccountWithDataSet account, Uri uri) {
         mListener.onCustomEditContactActivityRequested(account, uri, null, false);
     }
 
     @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Override the home/done options to return to the compact editor
+        if (item.getItemId() == android.R.id.home || item.getItemId() == R.id.menu_done) {
+            return save(SaveMode.COMPACT);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
     public void onEditorExpansionChanged() {
         updatedExpandedEditorsMap();
     }
@@ -355,6 +376,53 @@
         }
     }
 
+    @Override
+    public String getDisplayName() {
+        // Return the super primary name if it is non-empty
+        for (int i = 0; i < mContent.getChildCount(); i++) {
+            final View view = mContent.getChildAt(i);
+            if (view instanceof RawContactEditorView) {
+                final RawContactEditorView rawContactEditorView = (RawContactEditorView) view;
+                final StructuredNameEditorView nameEditorView =
+                        rawContactEditorView.getNameEditor();
+                if (nameEditorView != null) {
+                    final ValuesDelta valuesDelta = nameEditorView.getValues();
+                    if (valuesDelta != null && valuesDelta.isSuperPrimary()) {
+                        final String displayName = valuesDelta.getDisplayName();
+                        if (!TextUtils.isEmpty(displayName)) {
+                            return displayName;
+                        }
+                    }
+                }
+            }
+        }
+        // Return the first non-empty name
+        for (int i = 0; i < mContent.getChildCount(); i++) {
+            final View view = mContent.getChildAt(i);
+            if (view instanceof RawContactEditorView) {
+                final RawContactEditorView rawContactEditorView = (RawContactEditorView) view;
+                final StructuredNameEditorView nameEditorView =
+                        rawContactEditorView.getNameEditor();
+                if (nameEditorView != null) {
+                    final ValuesDelta valuesDelta = nameEditorView.getValues();
+                    if (valuesDelta != null) {
+                        final String displayName = valuesDelta.getDisplayName();
+                        if (!TextUtils.isEmpty(displayName)) {
+                            return displayName;
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public MaterialColorMapUtils.MaterialPalette getMaterialPalette() {
+        // There is no color for default photos on the fully expanded editor
+        return null;
+    }
+
     /**
      * Adjust how dark the hint text should be on all the names' text fields.
      *
diff --git a/src/com/android/contacts/editor/EditorIntents.java b/src/com/android/contacts/editor/EditorIntents.java
new file mode 100644
index 0000000..121b8c8
--- /dev/null
+++ b/src/com/android/contacts/editor/EditorIntents.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.contacts.editor;
+
+import com.android.contacts.activities.CompactContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity;
+import com.android.contacts.activities.ContactEditorBaseActivity;
+import com.android.contacts.common.model.RawContactDeltaList;
+import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
+
+import android.content.ContentValues;
+import android.content.Intent;
+import android.net.Uri;
+import android.provider.ContactsContract;
+import android.provider.ContactsContract.Contacts;
+import android.text.TextUtils;
+
+import java.util.ArrayList;
+
+/**
+ * Creates Intents to edit contacts.
+ */
+public class EditorIntents {
+
+    private EditorIntents() {
+    }
+
+    /**
+     * Returns an Intent to start the {@link CompactContactEditorActivity} for an
+     * existing contact.
+     */
+    public static Intent createCompactEditContactIntent(Uri contactLookupUri,
+            MaterialPalette materialPalette) {
+        final Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+        if (materialPalette != null) {
+            intent.putExtra(ContactEditorBaseActivity.INTENT_KEY_MATERIAL_PALETTE,
+                    materialPalette);
+        }
+        return intent;
+    }
+
+    /**
+     * Returns an Intent to start the {@link CompactContactEditorActivity} for a new contact.
+     */
+    public static Intent createCompactInsertContactIntent() {
+        return createCompactInsertContactIntent(/* materialPalette =*/ null,
+                /* rawContactDeltaList =*/ null, /* displayName =*/ null);
+    }
+
+    /**
+     * Returns an Intent to start the {@link CompactContactEditorActivity} for a new contact with
+     * the field values specified by rawContactDeltaList pre-populate in the form.
+     */
+    public static Intent createCompactInsertContactIntent(MaterialPalette materialPalette,
+            RawContactDeltaList rawContactDeltaList, String displayName) {
+        final Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+        if (materialPalette != null) {
+            intent.putExtra(ContactEditorBaseActivity.INTENT_KEY_MATERIAL_PALETTE,
+                    materialPalette);
+        }
+        if (rawContactDeltaList != null || displayName != null) {
+            putRawContactDeltaValues(intent, rawContactDeltaList, displayName);
+        }
+        return intent;
+    }
+
+    /**
+     * Returns an Intent to edit a different contact (in the fully expaned editor) with whatever
+     * values were already entered on the currently displayed contact editor.
+     */
+    public static Intent createEditOtherContactIntent(Uri contactLookupUri,
+            ArrayList<ContentValues> contentValues) {
+        final Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
+        intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
+                | Intent.FLAG_ACTIVITY_FORWARD_RESULT);
+        intent.putExtra(ContactEditorFragment.INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY, "");
+
+        // Pass on all the data that has been entered so far
+        if (contentValues != null && contentValues.size() != 0) {
+            intent.putParcelableArrayListExtra(ContactsContract.Intents.Insert.DATA, contentValues);
+        }
+        return intent;
+    }
+
+    /**
+     * Returns an Intent to start the fully expanded {@link ContactEditorActivity} for a
+     * new contact.
+     */
+    public static Intent createEditContactIntent(Uri contactLookupUri) {
+        final Intent intent = new Intent(ContactEditorBaseActivity.ACTION_EDIT, contactLookupUri);
+        addContactIntentFlags(intent);
+        return intent;
+    }
+
+    /**
+     * Returns an Intent to start the fully expanded {@link ContactEditorActivity} for an
+     * existing contact.
+     */
+    public static Intent createInsertContactIntent(RawContactDeltaList rawContactDeltaList,
+            String displayName) {
+        final Intent intent = new Intent(ContactEditorBaseActivity.ACTION_INSERT,
+                ContactsContract.Contacts.CONTENT_URI);
+        addContactIntentFlags(intent);
+        putRawContactDeltaValues(intent, rawContactDeltaList, displayName);
+        return intent;
+    }
+
+
+    private static void addContactIntentFlags(Intent intent) {
+        intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
+                | Intent.FLAG_ACTIVITY_FORWARD_RESULT);
+    }
+
+    private static void putRawContactDeltaValues(Intent intent,
+            RawContactDeltaList rawContactDeltaList, String displayName) {
+        // Pass on all the data that has been entered so far
+        ArrayList<ContentValues> contentValues = rawContactDeltaList.get(0).getContentValues();
+        if (contentValues != null && contentValues.size() != 0) {
+            intent.putParcelableArrayListExtra(
+                    ContactsContract.Intents.Insert.DATA, contentValues);
+        }
+        // Name must be passed separately since it is skipped in RawContactModifier.parseValues
+        if (!TextUtils.isEmpty(displayName)) {
+            intent.putExtra(ContactsContract.Intents.Insert.NAME, displayName);
+        }
+    }
+}
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index da954c9..3584fa8 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -92,7 +92,6 @@
 import com.android.contacts.ContactsActivity;
 import com.android.contacts.NfcHandler;
 import com.android.contacts.R;
-import com.android.contacts.activities.ContactEditorBaseActivity;
 import com.android.contacts.common.CallUtil;
 import com.android.contacts.common.ClipboardUtils;
 import com.android.contacts.common.Collapser;
@@ -129,6 +128,7 @@
 import com.android.contacts.common.util.ViewUtil;
 import com.android.contacts.detail.ContactDisplayUtils;
 import com.android.contacts.editor.ContactEditorFragment;
+import com.android.contacts.editor.EditorIntents;
 import com.android.contacts.interactions.CalendarInteractionsLoader;
 import com.android.contacts.interactions.CallLogInteractionsLoader;
 import com.android.contacts.interactions.ContactDeletionInteraction;
@@ -2176,14 +2176,9 @@
     }
 
     private Intent getEditContactIntent() {
-        final Intent intent = new Intent(Intent.ACTION_EDIT, mContactData.getLookupUri());
-        intent.setPackage(this.getPackageName());
-        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
-        if (mHasComputedThemeColor) {
-            intent.putExtra(ContactEditorBaseActivity.INTENT_KEY_MATERIAL_PALETTE,
-                    new MaterialPalette(mColorFilterColor, mStatusBarColor));
-        }
-        return intent;
+        return EditorIntents.createCompactEditContactIntent(
+                mContactData.getLookupUri(), mHasComputedThemeColor
+                        ? new MaterialPalette(mColorFilterColor, mStatusBarColor) : null);
     }
 
     private void editContact() {
