Code example for FragmentActivity

Methods: getActionBar

0
 
	@Override 
	public void onRestoreInstanceState(Bundle savedInstanceState) {
		// Restore the previously serialized current tab 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 tab 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_home, menu);
		return true; 
Experience pair programming with AI  Get Codota for Java