Code example for DialogFragment

Methods: getDialog, setCancelable, show

0
        assertFalse(shadowOf(dialog).isCancelable());
    } 
 
    @Test 
    public void shouldSetNotCancelableOnDialogAfterShow() throws Exception { 
        DialogFragment dialogFragment = new DialogFragment();
        dialogFragment.show(fragmentManager, "TAG");
        dialogFragment.setCancelable(false);
 
        Dialog dialog = dialogFragment.getDialog();
 
        assertFalse(shadowOf(dialog).isCancelable());
    } 
 
    private class TestDialogFragment extends DialogFragment {
        final Transcript transcript = new Transcript();
        Activity onAttachActivity;
        private Dialog returnThisDialogFromOnCreateDialog;
 
        @Override 
        public void onAttach(Activity activity) {