diff --git a/src/com/android/contacts/activities/ContactBrowserActivity.java b/src/com/android/contacts/activities/ContactBrowserActivity.java
index b7afc1b..a70fbc4 100644
--- a/src/com/android/contacts/activities/ContactBrowserActivity.java
+++ b/src/com/android/contacts/activities/ContactBrowserActivity.java
@@ -35,7 +35,6 @@
 import com.android.contacts.views.ContactSaveService;
 import com.android.contacts.views.detail.ContactDetailFragment;
 import com.android.contacts.views.detail.ContactNoneFragment;
-import com.android.contacts.views.editor.ContactEditorFragment;
 import com.android.contacts.widget.ContextMenuAdapter;
 
 import android.accounts.Account;
@@ -104,9 +103,6 @@
     private ContactDetailFragment mDetailFragment;
     private DetailFragmentListener mDetailFragmentListener = new DetailFragmentListener();
 
-    private ContactEditorFragment mEditorFragment;
-    private EditorFragmentListener mEditorFragmentListener = new EditorFragmentListener();
-
     private PhoneNumberInteraction mPhoneNumberCallInteraction;
     private PhoneNumberInteraction mSendTextMessageInteraction;
     private ContactDeletionInteraction mContactDeletionInteraction;
@@ -135,9 +131,6 @@
         } else if (fragment instanceof ContactDetailFragment) {
             mDetailFragment = (ContactDetailFragment)fragment;
             mDetailFragment.setListener(mDetailFragmentListener);
-        } else if (fragment instanceof ContactEditorFragment) {
-            mEditorFragment = (ContactEditorFragment)fragment;
-            mEditorFragment.setListener(mEditorFragmentListener);
         }
     }
 
@@ -342,25 +335,11 @@
     }
 
     private void setupContactDetailFragment(Uri contactLookupUri) {
-
-        // If we are already editing this URI - just continue editing
-        if (mEditorFragment != null && contactLookupUri != null
-                && contactLookupUri.equals(mEditorFragment.getLookupUri())) {
-            return;
-        }
-
         if (mDetailFragment != null && contactLookupUri != null
                 && contactLookupUri.equals(mDetailFragment.getUri())) {
             return;
         }
 
-        // If we are closing the editor, it's a good idea to scroll the list
-        // to the contact we have just finished editing.
-        boolean scrollToSelection = mEditorFragment != null;
-
-        // No editor here
-        closeEditorFragment(true);
-
         if (contactLookupUri != null) {
             // Already showing? Nothing to do
             if (mDetailFragment != null) {
@@ -385,27 +364,6 @@
                     .replace(R.id.detail_container, mEmptyFragment)
                     .commit();
         }
-        if (scrollToSelection) {
-            mListFragment.requestSelectionOnScreen(true);
-        }
-    }
-
-    private void setupContactEditorFragment(Uri contactLookupUri) {
-        // No detail view here
-        closeDetailFragment();
-        closeEmptyFragment();
-
-        // Already showing? Nothing to do
-        if (mEditorFragment != null) return;
-
-        mEditorFragment = new ContactEditorFragment();
-        mEditorFragment.load(Intent.ACTION_EDIT, contactLookupUri,
-                Contacts.CONTENT_ITEM_TYPE, new Bundle());
-
-        // Nothing showing yet? Create (this happens during Activity-Startup)
-        getFragmentManager().openTransaction()
-                .replace(R.id.detail_container, mEditorFragment)
-                .commit();
     }
 
     private void closeDetailFragment() {
@@ -415,23 +373,6 @@
         }
     }
 
-    /**
-     * Closes the editor, if it is currently open
-     * @param save Whether the changes should be saved. This should always be true, unless
-     * this is called from a Revert/Undo button
-     */
-    private void closeEditorFragment(boolean save) {
-        Log.d(TAG, "closeEditorFragment(" + save + ")");
-
-        if (mEditorFragment != null) {
-            // Remove the listener before saving, because it will be used to forward the onClose
-            // after save
-            mEditorFragment.setListener(null);
-            if (save) mEditorFragment.save(true);
-            mEditorFragment = null;
-        }
-    }
-
     private void closeEmptyFragment() {
         mEmptyFragment = null;
     }
@@ -524,9 +465,9 @@
     }
 
     private final class ContactBrowserActionListener implements OnContactBrowserActionListener {
-        public void onViewContactAction(Uri contactLookupUri, boolean force) {
+        @Override
+        public void onViewContactAction(Uri contactLookupUri) {
             if (mContactContentDisplayed) {
-                if (force) closeEditorFragment(true);
                 setSelectedContactUri(contactLookupUri);
                 setupContactDetailFragment(contactLookupUri);
             } else {
@@ -534,6 +475,7 @@
             }
         }
 
+        @Override
         public void onCreateNewContactAction() {
             Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
             Bundle extras = getIntent().getExtras();
@@ -543,45 +485,46 @@
             startActivity(intent);
         }
 
+        @Override
         public void onEditContactAction(Uri contactLookupUri) {
-            if (mContactContentDisplayed) {
-                closeEditorFragment(true);
-                setSelectedContactUri(contactLookupUri);
-                setupContactEditorFragment(contactLookupUri);
-            } else {
-                Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
-                Bundle extras = getIntent().getExtras();
-                if (extras != null) {
-                    intent.putExtras(extras);
-                }
-                startActivityForResult(intent, SUBACTIVITY_EDIT_CONTACT);
+            Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
+            Bundle extras = getIntent().getExtras();
+            if (extras != null) {
+                intent.putExtras(extras);
             }
+            startActivityForResult(intent, SUBACTIVITY_EDIT_CONTACT);
         }
 
+        @Override
         public void onAddToFavoritesAction(Uri contactUri) {
             ContentValues values = new ContentValues(1);
             values.put(Contacts.STARRED, 1);
             getContentResolver().update(contactUri, values, null, null);
         }
 
+        @Override
         public void onRemoveFromFavoritesAction(Uri contactUri) {
             ContentValues values = new ContentValues(1);
             values.put(Contacts.STARRED, 0);
             getContentResolver().update(contactUri, values, null, null);
         }
 
+        @Override
         public void onCallContactAction(Uri contactUri) {
             getPhoneNumberCallInteraction().startInteraction(contactUri);
         }
 
+        @Override
         public void onSmsContactAction(Uri contactUri) {
             getSendTextMessageInteraction().startInteraction(contactUri);
         }
 
+        @Override
         public void onDeleteContactAction(Uri contactUri) {
             getContactDeletionInteraction().deleteContact(contactUri);
         }
 
+        @Override
         public void onFinishAction() {
             onBackPressed();
         }
@@ -623,54 +566,6 @@
         }
     }
 
-    private class EditorFragmentListener implements ContactEditorFragment.Listener {
-        @Override
-        public void onReverted() {
-            final Uri uri = mEditorFragment.getLookupUri();
-            closeEditorFragment(false);
-            setupContactDetailFragment(uri);
-        }
-
-        @Override
-        public void onSaveFinished(int resultCode, Intent resultIntent) {
-            Log.d(TAG, "onSaveFinished(" + resultCode + "," + resultIntent + ")");
-            // it is already saved, so no need to save again here
-            final Uri uri = mEditorFragment.getLookupUri();
-            closeEditorFragment(false);
-            setupContactDetailFragment(uri);
-        }
-
-        @Override
-        public void onAggregationChangeFinished(Uri newLookupUri) {
-            // We have already saved. Close the editor so that we can open again with the
-            // new contact
-            Log.d(TAG, "onAggregationChangeFinished(" + newLookupUri + ")");
-            closeEditorFragment(false);
-            setSelectedContactUri(newLookupUri);
-            setupContactDetailFragment(newLookupUri);
-        }
-
-        @Override
-        public void onAccountSelectorAborted() {
-            Toast.makeText(ContactBrowserActivity.this, "closeBecauseAccountSelectorAborted",
-                    Toast.LENGTH_LONG).show();
-        }
-
-        @Override
-        public void onContactNotFound() {
-            setupContactDetailFragment(null);
-        }
-
-        @Override
-        public void setTitleTo(int resourceId) {
-        }
-
-        @Override
-        public void onDeleteRequested(Uri contactLookupUri) {
-            getContactDeletionInteraction().deleteContact(contactLookupUri);
-        }
-    }
-
     public void startActivityAndForwardResult(final Intent intent) {
         intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
 
diff --git a/src/com/android/contacts/activities/ContactSearchActivity.java b/src/com/android/contacts/activities/ContactSearchActivity.java
index 708099c..5b52d9a 100644
--- a/src/com/android/contacts/activities/ContactSearchActivity.java
+++ b/src/com/android/contacts/activities/ContactSearchActivity.java
@@ -75,10 +75,12 @@
         mSearchEditText = (SearchEditText)findViewById(R.id.search_src_text);
         mSearchEditText.setText(mRequest.getQueryString());
         mSearchEditText.setOnFilterTextListener(new OnFilterTextListener() {
+            @Override
             public void onFilterChange(String queryString) {
                 mListFragment.setQueryString(queryString);
             }
 
+            @Override
             public void onCancelSearch() {
                 finish();
             }
@@ -106,13 +108,16 @@
     }
 
     private final class ContactBrowserActionListener implements OnContactBrowserActionListener {
-        public void onViewContactAction(Uri contactLookupUri, boolean force) {
+        @Override
+        public void onViewContactAction(Uri contactLookupUri) {
             startActivity(new Intent(Intent.ACTION_VIEW, contactLookupUri));
         }
 
+        @Override
         public void onCreateNewContactAction() {
         }
 
+        @Override
         public void onEditContactAction(Uri contactLookupUri) {
             Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
             Bundle extras = getIntent().getExtras();
@@ -122,30 +127,36 @@
             startActivity(intent);
         }
 
+        @Override
         public void onAddToFavoritesAction(Uri contactUri) {
             ContentValues values = new ContentValues(1);
             values.put(Contacts.STARRED, 1);
             getContentResolver().update(contactUri, values, null, null);
         }
 
+        @Override
         public void onRemoveFromFavoritesAction(Uri contactUri) {
             ContentValues values = new ContentValues(1);
             values.put(Contacts.STARRED, 0);
             getContentResolver().update(contactUri, values, null, null);
         }
 
+        @Override
         public void onCallContactAction(Uri contactUri) {
             getPhoneNumberCallInteraction().startInteraction(contactUri);
         }
 
+        @Override
         public void onSmsContactAction(Uri contactUri) {
             getSendTextMessageInteraction().startInteraction(contactUri);
         }
 
+        @Override
         public void onDeleteContactAction(Uri contactUri) {
             getContactDeletionInteraction().deleteContact(contactUri);
         }
 
+        @Override
         public void onFinishAction() {
             onBackPressed();
         }
diff --git a/src/com/android/contacts/activities/ContactSelectionActivity.java b/src/com/android/contacts/activities/ContactSelectionActivity.java
index bd2834d..938bf0a 100644
--- a/src/com/android/contacts/activities/ContactSelectionActivity.java
+++ b/src/com/android/contacts/activities/ContactSelectionActivity.java
@@ -49,14 +49,8 @@
  * purposes of selecting one.
  */
 public class ContactSelectionActivity extends Activity implements View.OnCreateContextMenuListener {
-
     private static final String TAG = "ContactSelectionActivity";
 
-    private static final int SUBACTIVITY_NEW_CONTACT = 1;
-    private static final int SUBACTIVITY_VIEW_CONTACT = 2;
-    private static final int SUBACTIVITY_DISPLAY_GROUP = 3;
-    private static final int SUBACTIVITY_SEARCH = 4;
-
     private ContactsIntentResolver mIntentResolver;
     protected ContactEntryListFragment<?> mListFragment;
 
@@ -113,10 +107,12 @@
         mSearchEditText = (SearchEditText)findViewById(R.id.search_src_text);
         mSearchEditText.setText(mRequest.getQueryString());
         mSearchEditText.setOnFilterTextListener(new OnFilterTextListener() {
+            @Override
             public void onFilterChange(String queryString) {
                 mListFragment.setQueryString(queryString);
             }
 
+            @Override
             public void onCancelSearch() {
                 finish();
             }
@@ -229,10 +225,12 @@
     }
 
     private final class ContactBrowserActionListener implements OnContactBrowserActionListener {
-        public void onViewContactAction(Uri contactLookupUri, boolean force) {
+        @Override
+        public void onViewContactAction(Uri contactLookupUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onCreateNewContactAction() {
             Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
             Bundle extras = getIntent().getExtras();
@@ -242,6 +240,7 @@
             startActivity(intent);
         }
 
+        @Override
         public void onEditContactAction(Uri contactLookupUri) {
             Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
             Bundle extras = getIntent().getExtras();
@@ -251,43 +250,52 @@
             startActivity(intent);
         }
 
+        @Override
         public void onAddToFavoritesAction(Uri contactUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onRemoveFromFavoritesAction(Uri contactUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onCallContactAction(Uri contactUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onSmsContactAction(Uri contactUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onDeleteContactAction(Uri contactUri) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public void onFinishAction() {
             onBackPressed();
         }
     }
 
     private final class ContactPickerActionListener implements OnContactPickerActionListener {
+        @Override
         public void onCreateNewContactAction() {
             Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
             startActivityAndForwardResult(intent);
         }
 
+        @Override
         public void onPickContactAction(Uri contactUri) {
             Intent intent = new Intent();
             setResult(RESULT_OK, intent.setData(contactUri));
             finish();
         }
 
+        @Override
         public void onShortcutIntentCreated(Intent intent) {
             setResult(RESULT_OK, intent);
             finish();
@@ -296,12 +304,14 @@
 
     private final class PhoneNumberPickerActionListener implements
             OnPhoneNumberPickerActionListener {
+        @Override
         public void onPickPhoneNumberAction(Uri dataUri) {
             Intent intent = new Intent();
             setResult(RESULT_OK, intent.setData(dataUri));
             finish();
         }
 
+        @Override
         public void onShortcutIntentCreated(Intent intent) {
             setResult(RESULT_OK, intent);
             finish();
@@ -310,6 +320,7 @@
 
     private final class PostalAddressPickerActionListener implements
             OnPostalAddressPickerActionListener {
+        @Override
         public void onPickPostalAddressAction(Uri dataUri) {
             Intent intent = new Intent();
             setResult(RESULT_OK, intent.setData(dataUri));
diff --git a/src/com/android/contacts/list/ContactBrowseListContextMenuAdapter.java b/src/com/android/contacts/list/ContactBrowseListContextMenuAdapter.java
index 9ed6ad9..f2a53ca 100644
--- a/src/com/android/contacts/list/ContactBrowseListContextMenuAdapter.java
+++ b/src/com/android/contacts/list/ContactBrowseListContextMenuAdapter.java
@@ -48,6 +48,7 @@
         this.mContactListFragment = fragment;
     }
 
+    @Override
     public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
         AdapterView.AdapterContextMenuInfo info;
         try {
@@ -89,6 +90,7 @@
         menu.add(0, MENU_ITEM_DELETE, 0, R.string.menu_deleteContact);
     }
 
+    @Override
     public boolean onContextItemSelected(MenuItem item) {
         AdapterView.AdapterContextMenuInfo info;
         try {
@@ -105,7 +107,7 @@
         final Uri contactUri = adapter.getContactUri(position);
         switch (item.getItemId()) {
             case MENU_ITEM_VIEW_CONTACT: {
-                mContactListFragment.viewContact(contactUri, true);
+                mContactListFragment.viewContact(contactUri);
                 return true;
             }
 
diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index e780c5c..f99134b 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -203,8 +203,8 @@
         mListener.onCreateNewContactAction();
     }
 
-    public void viewContact(Uri contactUri, boolean finishEditing) {
-        mListener.onViewContactAction(contactUri, finishEditing);
+    public void viewContact(Uri contactUri) {
+        mListener.onViewContactAction(contactUri);
     }
 
     public void editContact(Uri contactUri) {
diff --git a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
index 10f2290..4d66dd2 100644
--- a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
@@ -91,7 +91,7 @@
                 editContact(adapter.getContactUri(position));
             }
         } else {
-            viewContact(adapter.getContactUri(position), false);
+            viewContact(adapter.getContactUri(position));
         }
     }
 
diff --git a/src/com/android/contacts/list/OnContactBrowserActionListener.java b/src/com/android/contacts/list/OnContactBrowserActionListener.java
index 5291639..239f8e1 100644
--- a/src/com/android/contacts/list/OnContactBrowserActionListener.java
+++ b/src/com/android/contacts/list/OnContactBrowserActionListener.java
@@ -26,9 +26,8 @@
      * Opens the specified contact for viewing.
      *
      * @param contactLookupUri The lookup-uri of the Contact that should be opened
-     * @param finishEditing The user has explicitly requested to leave the edit mode
      */
-    void onViewContactAction(Uri contactLookupUri, boolean finishEditing);
+    void onViewContactAction(Uri contactLookupUri);
 
     /**
      * Creates a new contact.
diff --git a/src/com/android/contacts/list/StrequentContactListFragment.java b/src/com/android/contacts/list/StrequentContactListFragment.java
index 722e3b7..393e698 100644
--- a/src/com/android/contacts/list/StrequentContactListFragment.java
+++ b/src/com/android/contacts/list/StrequentContactListFragment.java
@@ -58,7 +58,7 @@
     @Override
     protected void onItemClick(int position, long id) {
         ContactListAdapter adapter = getAdapter();
-        viewContact(adapter.getContactUri(position), false);
+        viewContact(adapter.getContactUri(position));
     }
 
     @Override
@@ -94,6 +94,7 @@
         setEmptyText(R.string.noFavoritesHelpText);
     }
 
+    @Override
     public void onClick(View v) {
         int id = v.getId();
         switch (id) {
