Code example for FragmentTransaction

Methods: addToBackStack, remove, show

0
 
        FragmentManager fm = activity.getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        Fragment prev = fm.findFragmentByTag("changelog_about");
        if (prev != null) {
            ft.remove(prev);
        } 
        ft.addToBackStack(null);
 
        new ChangeLogDialog().show(ft,"changeLog_about");
    } 
 
    /** 
     * ChangeLogDialog 
     */ 
    public static class ChangeLogDialog extends DialogFragment {
 
 
        public ChangeLogDialog() { 
        }