Code example for DialogFragment

0
import android.support.v4.app.DialogFragment; 
import android.view.ContextThemeWrapper; 
import android.view.View; 
import android.widget.EditText; 
 
public class EditNoteDialog extends DialogFragment {
 
    public interface EditNoteDialogListener { 
        void onFinishEditNoteDialog(final String inputText);
    } 
 
    public static final String ARGUMENT_INITIAL_NOTE = "initialNote";
 
    private EditText mEditText;
    private EditNoteDialogListener listener;
 
    public static EditNoteDialog newInstance(final String initialNote, EditNoteDialogListener listener) {
        EditNoteDialog dialog = new EditNoteDialog();
 
        Bundle arguments = new Bundle();
        arguments.putString(EditNoteDialog.ARGUMENT_INITIAL_NOTE, initialNote);