Code example for FragmentActivity

Methods: getIntent, getSupportFragmentManager, onCreate

0
 */ 
public class DetailsActivity extends FragmentActivity { 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
 
        if (savedInstanceState == null) { 
            // During initial setup, plug in the details fragment. 
            //DetailsFragment details = DetailsFragment.newInstance(getIntent().getIntExtra(DetailsFragment.ARG_INDEX, 0), getIntent().getStringExtra(DetailsFragment.ARG_SEARCH)); 
            DetailsFragment details = new DetailsFragment(); 
            details.setArguments(getIntent().getExtras()); 
            getSupportFragmentManager().beginTransaction().add(android.R.id.content, details).commit(); 
        } 
    } 
 
}