Code example for FragmentActivity

Methods: getIntent, getSupportFragmentManager, onCreate

0
 
public class RageFaceViewerActivity extends FragmentActivity { 
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
 
		if (savedInstanceState == null) {
			FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
			ViewerFragment viewer = new ViewerFragment();
			viewer.setArguments(getIntent().getExtras());
			ft.add(android.R.id.content, viewer);
			ft.commit();
		} 
	} 
}