Code example for FragmentActivity

Methods: getIntent, getSupportFragmentManager, onCreate, setContentView

0
	public static final int LAYOUT_ID = 5214865;
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		 
		super.onCreate(savedInstanceState);
 
		Partie toSynchro = getIntent().getExtras().getParcelable("Partie");
 
		DescriptionPartie ppl = new DescriptionPartie();
 
		ppl.setPartie(toSynchro);
 
		FrameLayout frame = new FrameLayout(this);
		frame.setId(LAYOUT_ID);
		setContentView(frame, new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));
 
		FragmentTransaction transac = getSupportFragmentManager()
				.beginTransaction(); 
		transac.add(LAYOUT_ID, ppl);
		transac.commit();
	}