Answers for "replace fragment with case android"

0

replace fragment in new layout android

FragmentManager fm = getFragmentManager();

if (fm != null) {
    // Perform the FragmentTransaction to load in the list tab content.
    // Using FragmentTransaction#replace will destroy any Fragments
    // currently inside R.id.fragment_content and add the new Fragment
    // in its place.
    FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container, new YourFragment());
    ft.commit();
}
Posted by: Guest on December-26-2021

Code answers related to "replace fragment with case android"

Browse Popular Code Answers by Language