Code example for FragmentTransaction

Methods: addToBackStack, commit, replace

0
        // Create the list fragment and add it as our sole content. 
        ReportTripProblemFragment content = new ReportTripProblemFragment();
        content.setArguments(args);
 
        FragmentTransaction ft = fm.beginTransaction();
        ft.replace(android.R.id.content, content);
        ft.addToBackStack(null);
        ft.commit();
    } 
 
    private Spinner mCodeView;
    private TextView mUserComment;
    private CheckBox mUserOnVehicle;
    private TextView mUserVehicle;
 
    @Override 
    protected int getLayoutId() { 
        return R.layout.report_trip_problem; 
    } 
 
    @Override