Code example for FragmentTransaction

Methods: addToBackStackcommitreplace

0
        // Create the list fragment and add it as our sole content. 
        ReportStopProblemFragment content = new ReportStopProblemFragment();
        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;
 
    @Override 
    protected int getLayoutId() { 
        return R.layout.report_stop_problem; 
    } 
 
    @Override 
    public void onViewCreated(View view, Bundle savedInstanceState) {
        // Set the stop name.