@Test public void addSupportFragmentToActivity_AddsNewFragment() { SupportActivityUtils.addSupportFragmentToActivity(mFragmentManager, mFragment, TEST_TAG); then(mFragmentTransaction).should().add(mFragment, TEST_TAG); }
@SuppressWarnings("WeakerAccess") public static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @NonNull final String tag) { checkNotNull(fragmentManager, "fragmentManager must not be null!"); checkNotNull(fragment, "fragment must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); removeSupportFragment(fragmentManager, tag); final FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(fragment, tag); transaction.commitAllowingStateLoss(); }
SupportActivityUtils { @SuppressWarnings("WeakerAccess") public static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @NonNull final String tag) { checkNotNull(fragmentManager, "fragmentManager must not be null!"); checkNotNull(fragment, "fragment must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); removeSupportFragment(fragmentManager, tag); final FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(fragment, tag); transaction.commitAllowingStateLoss(); } }
SupportActivityUtils { @SuppressWarnings("WeakerAccess") public static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @NonNull final String tag) { checkNotNull(fragmentManager, "fragmentManager must not be null!"); checkNotNull(fragment, "fragment must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); removeSupportFragment(fragmentManager, tag); final FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(fragment, tag); transaction.commitAllowingStateLoss(); } private  SupportActivityUtils(); }
SupportActivityUtils { @SuppressWarnings("WeakerAccess") public static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @NonNull final String tag) { checkNotNull(fragmentManager, "fragmentManager must not be null!"); checkNotNull(fragment, "fragment must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); removeSupportFragment(fragmentManager, tag); final FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(fragment, tag); transaction.commitAllowingStateLoss(); } private  SupportActivityUtils(); @SuppressWarnings("WeakerAccess") static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager,
                                                    @NonNull final Fragment fragment,
                                                    @NonNull final String tag); @NonNull static Fragment findOrCreateSupportFragment(@NonNull final FragmentManager fragmentManager, @NonNull final String tag); @SuppressWarnings("WeakerAccess") static void removeSupportFragment(@NonNull final FragmentManager fragmentManager,
                                             @NonNull final String tag); }
SupportActivityUtils { @SuppressWarnings("WeakerAccess") public static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @NonNull final String tag) { checkNotNull(fragmentManager, "fragmentManager must not be null!"); checkNotNull(fragment, "fragment must not be null!"); checkNotNull(tag, "tag must not be null!"); checkArgument(!tag.isEmpty(), "tag string must not be empty!"); removeSupportFragment(fragmentManager, tag); final FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(fragment, tag); transaction.commitAllowingStateLoss(); } private  SupportActivityUtils(); @SuppressWarnings("WeakerAccess") static void addSupportFragmentToActivity(@NonNull final FragmentManager fragmentManager,
                                                    @NonNull final Fragment fragment,
                                                    @NonNull final String tag); @NonNull static Fragment findOrCreateSupportFragment(@NonNull final FragmentManager fragmentManager, @NonNull final String tag); @SuppressWarnings("WeakerAccess") static void removeSupportFragment(@NonNull final FragmentManager fragmentManager,
                                             @NonNull final String tag);  }