Code example for FragmentActivity

Methods: getActionBar

0
 
	@Override 
	public void onRestoreInstanceState(Bundle savedInstanceState) {
		// Restore the previously serialized current dropdown position. 
		if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) {
			getActionBar().setSelectedNavigationItem( 
					savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM));
		} 
	} 
 
	@Override 
	public void onSaveInstanceState(Bundle outState) {
		// Serialize the current dropdown position. 
		outState.putInt(STATE_SELECTED_NAVIGATION_ITEM, getActionBar()
				.getSelectedNavigationIndex()); 
	} 
 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present. 
		getMenuInflater().inflate(R.menu.activity_main, menu);