Source:
public Dialog onCreateDialog(final Bundle savedInstanceState) { final @NonNull FragmentActivity activity = getActivity(); final Context themedContext; if (Settings.isLightSkin() && VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) { themedContext = new ContextThemeWrapper(activity, R.style.dark); } else { themedContext = activity; } final View view = View.inflate(themedContext, R.layout.fragment_edit_note, null); mEditText = ButterKnife.findById(view, R.id.note); final String initialNote = getArguments().getString(ARGUMENT_INITIAL_NOTE); if (initialNote != null) { mEditText.setText(initialNote); Dialogs.moveCursorToEnd(mEditText); getArguments().remove(ARGUMENT_INITIAL_NOTE); } final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); final AlertDialog dialog = builder.create(); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); final TextView title = ButterKnife.findById(view, R.id.dialog_title_title); if (title != null) { title.setText(R.string.cache_personal_note); title.setVisibility(View.VISIBLE); } final ImageButton cancel = ButterKnife.findById(view, R.id.dialog_title_cancel); if (cancel != null) { cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { dialog.dismiss(); } }); cancel.setVisibility(View.VISIBLE); } final ImageButton done = ButterKnife.findById(view, R.id.dialog_title_done); if (done != null) { done.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { ((EditNoteDialogListener) getActivity()).onFinishEditNoteDialog(mEditText.getText().toString()); dialog.dismiss(); } }); done.setVisibility(View.VISIBLE); } new Keyboard(activity).showDelayed(mEditText); return dialog; }

Target:
public Dialog onCreateDialog(final Bundle savedInstanceState) { final @NonNull FragmentActivity activity = getActivity(); final Context themedContext; if (Settings.isLightSkin() && VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) { themedContext = new ContextThemeWrapper(activity, R.style.dark); } else { themedContext = activity; } final View view = View.inflate(themedContext, R.layout.fragment_edit_note, null); mEditText = ButterKnife.findById(view, R.id.note); final String initialNote = getArguments().getString(ARGUMENT_INITIAL_NOTE); if (initialNote != null) { mEditText.setText(initialNote); Dialogs.moveCursorToEnd(mEditText); getArguments().remove(ARGUMENT_INITIAL_NOTE); } final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); final AlertDialog dialog = builder.create(); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); final TextView title = ButterKnife.findById(view, R.id.dialog_title_title); title.setText(R.string.cache_personal_note); title.setVisibility(View.VISIBLE); final ImageButton cancel = ButterKnife.findById(view, R.id.dialog_title_cancel); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { dialog.dismiss(); } }); cancel.setVisibility(View.VISIBLE); final ImageButton done = ButterKnife.findById(view, R.id.dialog_title_done); done.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { ((EditNoteDialogListener) getActivity()).onFinishEditNoteDialog(mEditText.getText().toString()); dialog.dismiss(); } }); done.setVisibility(View.VISIBLE); new Keyboard(activity).showDelayed(mEditText); return dialog; }