Code example for ActionBar

Methods: getSelectedNavigationIndex

0
		if (action == null || !action.equals("Already created")) {
			// don't restart if action is present 
			Intent intent = new Intent(this, MainActivity.class);
			// pass the current selected tab information 
			intent.putExtra("TabIndex"
					, actionBar.getSelectedNavigationIndex());
			startActivity(intent);
			finish(); 
		} else { 
			// remove the unique action so the next time onResume 
			// call will force restart 
			getIntent().setAction(null); 
		} 
 
		super.onResume(); 
	} 
 
	/** 
	 * Takes the user to the Add Budget screen. 
	 * 
	 * @param view The reference to the Add Budget button.