Code example for ActionBarActivity

Methods: onOptionsItemSelected

0
		switch (item.getItemId()) {
		case android.R.id.home:
			onBackPressed(); 
			return true; 
		default: 
			return super.onOptionsItemSelected(item);
		} 
	} 
 
	private void setUpMapIfNeeded() { 
		// Do a null check to confirm that we have not already instantiated the map. 
		if (mGoogleMap == null) {
			// Try to obtain the map from the SupportMapFragment. 
			mGoogleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
		} 
	} 
 
	public void drawDirections() { 
		Bundle bundle = getIntent().getParcelableExtra(MainActivity.BUNDLE);
		LatLng from = bundle.getParcelable(MainActivity.FROM_ADDRESS);
Contextual code suggestions in your IDE  Get Codota for Java