Code example for ActionBar

Methods: getSelectedNavigationIndex

0
	 
	@Override 
	public boolean onNavigationItemSelected(int itemPosition, long itemId) {
		// TODO Auto-generated method stub 
		ActionBar actionBar = getActionBar();
		Log.d("debug", "Index is " + actionBar.getSelectedNavigationIndex());
		switch (itemPosition) {
		case 0: 
			Log.d("debug", "Start 0");
			if(actionBar.getSelectedNavigationIndex() == 0) {
			return true; 
			} 
			else { 
				return false; 
			} 
		case 2: 
			Log.d("debug", "Start 2");
			if(actionBar.getSelectedNavigationIndex() == 2) {
			//	FragmentTransaction ft = getFragmentManager().beginTransaction(); 
			//	ft.replace(R.id.LinearLayout1, new AboutSectionFragment()); 
            return true; 
			} 
			else { 
Contextual code suggestions in your IDE  Get Codota for Java