Code example for FragmentActivity

Methods: getIntent, getSupportFragmentManager, onCreate, setContentView

0
        return R.layout.container_activity; 
    } 
     
    BetterListFragment fragment;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         
        int cv = getContentView();
        if (0 != cv)
            setContentView(cv);
         
        try { 
            fragment = (BetterListFragment)clazz.getConstructors()[0].newInstance();
            fragment.setArguments(getIntent().getExtras());
            fragment.getInternal().setListener(this);
            getSupportFragmentManager().beginTransaction().replace(getListContainerId(), fragment, "betterlist").commit();
        } 
        catch (Exception e) {
            e.printStackTrace();
        } 
    }