Code example for FragmentActivity

Methods: getActionBar, getApplicationContext, getSupportFragmentManager, onCreate

0
 
public class AboutActivity extends FragmentActivity { 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        ((AppHelper) getApplicationContext()).updateUiLanguage(); 
 
        FragmentManager fm = getSupportFragmentManager();
 
        if (fm.findFragmentById(android.R.id.content) == null) {
            AboutFragment about = new AboutFragment();
            fm.beginTransaction().add(android.R.id.content, about).commit();
        } 
 
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            getActionBar().setHomeButtonEnabled(true); 
        } 
    } 
 
    /** 
     * Handle ActionBar and menu buttons.