@Test public void showIfNotShowing_onlyEverOpensOneDialog() { FragmentActivity activity = createThemedActivity(FragmentActivity.class); FragmentManager fragmentManager = activity.getSupportFragmentManager(); DialogUtils.showIfNotShowing(DialogFragment.class, fragmentManager); assertThat(fragmentManager.getFragments().size(), equalTo(1)); Fragment dialog1 = fragmentManager.getFragments().get(0); DialogUtils.showIfNotShowing(DialogFragment.class, fragmentManager); assertThat(fragmentManager.getFragments().size(), equalTo(1)); assertThat(fragmentManager.getFragments().get(0), equalTo(dialog1)); }
public static <T extends DialogFragment> void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager) { showIfNotShowing(dialogClass, null, fragmentManager); }
DialogUtils { public static <T extends DialogFragment> void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager) { showIfNotShowing(dialogClass, null, fragmentManager); } }
DialogUtils { public static <T extends DialogFragment> void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager) { showIfNotShowing(dialogClass, null, fragmentManager); } private  DialogUtils(); }
DialogUtils { public static <T extends DialogFragment> void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager) { showIfNotShowing(dialogClass, null, fragmentManager); } private  DialogUtils(); @NonNull static ListView createActionListView(@NonNull Context context); static void showDialog(Dialog dialog, Activity activity); static Dialog createErrorDialog(@NonNull Activity activity, String errorMsg, final boolean shouldExit); @Deprecated @Nullable static T getDialog(Class<T> dialogClass, FragmentManager fragmentManager); static void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager); static void showIfNotShowing(Class<T> dialogClass, @Nullable Bundle args, FragmentManager fragmentManager); static void dismissDialog(Class dialogClazz, FragmentManager fragmentManager); }
DialogUtils { public static <T extends DialogFragment> void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager) { showIfNotShowing(dialogClass, null, fragmentManager); } private  DialogUtils(); @NonNull static ListView createActionListView(@NonNull Context context); static void showDialog(Dialog dialog, Activity activity); static Dialog createErrorDialog(@NonNull Activity activity, String errorMsg, final boolean shouldExit); @Deprecated @Nullable static T getDialog(Class<T> dialogClass, FragmentManager fragmentManager); static void showIfNotShowing(Class<T> dialogClass, FragmentManager fragmentManager); static void showIfNotShowing(Class<T> dialogClass, @Nullable Bundle args, FragmentManager fragmentManager); static void dismissDialog(Class dialogClazz, FragmentManager fragmentManager);  }