Code example for FragmentActivity

Methods: getSupportFragmentManager, getIntent, onCreate

	public static final String EXTRA_RECIPE_INDEX = "recipeIndex"; 
	/** Called when the activity is first created. */ 
    public void onCreate(Bundle savedInstanceState) { 
    	// Get the recipe index 
    	int recipeIndex = getIntent().getIntExtra(EXTRA_RECIPE_INDEX, -1); 
    	// Show the new fragment (full screen) 
    	RecipeDetail details = RecipeDetail.newInstance(recipeIndex); 
        getSupportFragmentManager().beginTransaction().add(, details).commit(); 
Connect your IDE to all the code out there  Get Codota for Java