Code example for ListFragment

Methods: getFragmentManager

    public void showDeleteDialog(long noteId) {
        // will take care of adding the fragment 
        // in a transaction.  We also want to remove any currently showing 
        // dialog, so make our own transaction and take care of that here. 
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        Fragment prev = getFragmentManager().findFragmentByTag("dialog");
        if (prev != null) {
        // Create and show the dialog. 
        DialogFragment dialog = new DeleteNoteDialogFragment();, "dialog");
        this.noteId = noteId;
    // The dialog fragment receives a reference to this Activity through the 
    // Fragment.onAttach() callback, which it uses to call the following methods 
    // defined by the NoticeDialogFragment.NoticeDialogListener interface