Source:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); if (DisplayUtils.isLargeScreen(this)) { mIsShowingMarkdown = false; if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (getSupportFragmentManager().findFragmentByTag(TAG_NOTE_EDITOR) != null) { mNoteEditorFragment = (NoteEditorFragment) getSupportFragmentManager().findFragmentByTag(TAG_NOTE_EDITOR); } else if (DisplayUtils.isLandscape(this)) { addEditorFragment(); } if (mNoteListFragment != null) { mNoteListFragment.setActivateOnItemClick(true); mNoteListFragment.setDividerVisible(true); } if (mCurrentNote != null) onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); else { mNoteEditorFragment.setPlaceholderVisible(true); mNoteListFragment.getListView().clearChoices(); } invalidateOptionsMenu(); } else { if (mNoteListFragment.isHidden()) { if (mCurrentNote != null) onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.show(mNoteListFragment); ft.commitNowAllowingStateLoss(); } } } if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT && mNoteEditorFragment != null) { mCurrentNote = null; if (mNoteListFragment != null) { mNoteListFragment.setActivateOnItemClick(false); mNoteListFragment.setDividerVisible(false); mNoteListFragment.setActivatedPosition(ListView.INVALID_POSITION); mNoteListFragment.refreshList(); } FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.remove(mNoteEditorFragment); mNoteEditorFragment = null; ft.commitAllowingStateLoss(); fm.executePendingTransactions(); invalidateOptionsMenu(); } }

Target:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); if (DisplayUtils.isLargeScreen(this)) { mIsShowingMarkdown = false; if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (getSupportFragmentManager().findFragmentByTag(TAG_NOTE_EDITOR) != null) { mNoteEditorFragment = (NoteEditorFragment) getSupportFragmentManager().findFragmentByTag(TAG_NOTE_EDITOR); } else if (DisplayUtils.isLandscape(this)) { addEditorFragment(); } if (mNoteListFragment != null) { mNoteListFragment.setActivateOnItemClick(true); mNoteListFragment.setDividerVisible(true); } if (mCurrentNote != null) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); } else { mNoteEditorFragment.setPlaceholderVisible(true); mNoteListFragment.getListView().clearChoices(); } invalidateOptionsMenu(); } else { if (mNoteListFragment.isHidden()) { if (mCurrentNote != null) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); } } } } if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT && mNoteEditorFragment != null) { mCurrentNote = null; if (mNoteListFragment != null) { mNoteListFragment.setActivateOnItemClick(false); mNoteListFragment.setDividerVisible(false); mNoteListFragment.setActivatedPosition(ListView.INVALID_POSITION); mNoteListFragment.refreshList(); } FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.remove(mNoteEditorFragment); mNoteEditorFragment = null; ft.commitAllowingStateLoss(); fm.executePendingTransactions(); invalidateOptionsMenu(); } }