Code example for FragmentActivity

Methods: getActionBar

0
    } 
 
    @Override 
    public void onRestoreInstanceState(Bundle savedInstanceState) {
        if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) {
            getActionBar().setSelectedNavigationItem( 
                    savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM));
        } 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        outState.putInt(STATE_SELECTED_NAVIGATION_ITEM,
                getActionBar().getSelectedNavigationIndex()); 
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true; 
    }