title: Change Map Type in Android Map App
body: <p>I'm very new to programming. I'm taking a mobile development class and this is all new to me. 
  I have created a very basic Android app in Android studio that shows a standard Google Map. I need to create buttons on the app to change the map from normal, to satellite, terrain, and hybrid. I've been searching around here and on multiple other sources, but I don't know where to begin, or where to put the code I find on other sites. Can anyone help? I'm sure this is fairly easy, I just don't know what to do. </p>
  
  <p>Thanks!</p>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MapActivity"
      tools:ignore="MissingPrefix"&gt;
  
      &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:map="http://schemas.android.com/apk/res-auto"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:layout_margin="5dp"
          class="com.google.android.gms.maps.MapFragment"
          android:id="@+id/map"
          android:layout_alignParentTop="true"
          android:layout_alignParentStart="true"
          map:cameraBearing="112.5"
          map:cameraTargetLat="-33.796923"
          map:cameraTargetLng="150.922433"
          map:cameraTilt="30"
          map:cameraZoom="13"
          map:uiCompass="true"
          map:uiRotateGestures="true"
          map:uiScrollGestures="false"
          map:uiTiltGestures="true"
          map:uiZoomControls="true"
          map:uiZoomGestures="true"
       /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>.java file</p>
  
  <pre><code>package geog498v.mymap;
  
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class MapActivity extends FragmentActivity implements OnMapReadyCallback {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_map);
  
          MapFragment mapFragment = (MapFragment)     getFragmentManager().findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_map, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      public void onMapReady(GoogleMap googleMap) {
          googleMap.addMarker(new MarkerOptions().position(new LatLng(0,  0)).title("Marker"));
          googleMap.getUiSettings().setZoomControlsEnabled(true);
          googleMap.getUiSettings().setCompassEnabled(true);
          googleMap.getUiSettings().setMyLocationButtonEnabled(true);
          googleMap.getUiSettings().setMapToolbarEnabled(true);
          googleMap.getUiSettings().setZoomGesturesEnabled(true);
          googleMap.getUiSettings().setScrollGesturesEnabled(true);
          googleMap.getUiSettings().setTiltGesturesEnabled(true);
          googleMap.getUiSettings().setRotateGesturesEnabled(true);
      }
  
  }
  </code></pre>