Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;

public class Main {
    public static void replaceFragment(Activity activity, int containerViewId, Fragment fragment,
            String fragmentTag, String backStackTransitionName) {
        activity.getFragmentManager().beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                .replace(containerViewId, fragment, fragmentTag).addToBackStack(backStackTransitionName).commit();
    }
}