Code example for DialogFragment

Methods: show

0
        assertNull(fragmentManager.findFragmentByTag("tag"));
    } 
 
    @Test 
    public void removeUsingTransaction_shouldDismissTheDialog() throws Exception { 
        dialogFragment.show(fragmentManager, null);
 
        FragmentTransaction t = fragmentManager.beginTransaction();
        t.remove(dialogFragment);
        t.commit();
 
        Dialog dialog = ShadowDialog.getLatestDialog();
        assertFalse(dialog.isShowing());
        assertTrue(shadowOf(dialog).hasBeenDismissed());
    } 
     
    private class TestDialogFragment extends DialogFragment {
        final Transcript transcript = new Transcript();
        Activity onAttachActivity;
        private Dialog returnThisDialogFromOnCreateDialog;