title: Creating a Navigation bar on a map activity Android
body: <p>I have this map activity and i want to make a navigation bar/ drawer in it.
  there's an error in MapsActivity says "cannot resolve method setSupportActionBar(android.support.v7.widget.Toolbar)"</p>
  
  <p>MapsActivity.java </p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements   
   OnMapReadyCallback {
  
  String [] places= {"bais city","basay","bindoy"};
  AutoCompleteTextView textview;
  
  private GoogleMap mMap;
  private LatLng latLng;
  private Marker marker;
  
  private Toolbar category;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_maps);
      // Obtain the SupportMapFragment and get notified when the map is ready  
        to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) 
        getSupportFragmentManager()
              .findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  
      category = (Toolbar) findViewById(R.id.Navbar);
      setSupportActionBar(category); //i got my error here says cannot resolve  
       method
  
  }
  </code></pre>
  
  <p>Imports</p>
  
  <pre><code>import android.content.DialogInterface;
  import android.location.Address;
  import android.location.Geocoder;
  import android.preference.DialogPreference;
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.AlertDialog;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.AutoCompleteTextView;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.LatLngBounds;
  import com.google.android.gms.maps.model.Marker;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import java.io.IOException;
  import java.util.List;
  import java.util.Locale;
  </code></pre>
  
  <p>Maps activity layout (xml)</p>
  
  <pre><code>&lt;!--suppress ALL --&gt;
  &lt;LinearLayout xmlns:map="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"&gt;
  &lt;TextView
      android:text="@string/test"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/PSString"
      android:textSize="22sp"/&gt;
  
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"&gt;
  
      &lt;include layout="@layout/navigation"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
  
  
      &lt;AutoCompleteTextView
          android:layout_width="278dp"
          android:layout_height="wrap_content"
          android:id="@+id/autoCompleteTextView"
          tools:ignore="LabelFor" /&gt;
  
      &lt;Button
          android:text="@string/search"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/BTNSearch"
          android:layout_gravity="end"
          android:onClick="onSearch" /&gt;
  
      &lt;fragment
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.SupportMapFragment"
          android:layout_width="384dp"
          android:layout_height="554dp"
          tools:context="com.example.boneyflesh.homepage.MapsActivity"
          tools:layout="@layout/activity_main" /&gt;
      &lt;/LinearLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Navbar layout (xml)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.Toolbar    
  xmlns:android="http://schemas.android.com/apk/res/android"
  
  android:orientation="vertical" android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:id="@+id/Navbar"&gt;
  
  &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>
  
  <p>MainActivity</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  public void whatodo(View view){
      if(view.getId() == R.id.BTNStart){
          AlertDialog.Builder prompt = new  
          AlertDialog.Builder(MainActivity.this);
          prompt.setCancelable(false)
                  .setPositiveButton("Documents", new 
                    DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int 
                              which) {
  
                              }
                          }
                  )
                      .setNegativeButton("2D MAP", new 
                       DialogInterface.OnClickListener() {
                          @Override
                           public void onClick(DialogInterface dialog, int 
                           which) {
                              startActivity(new 
                          Intent(getApplicationContext(),MapsActivity.class));
                          }
                      }
                      );
  
  
          AlertDialog alert = prompt.create();
          alert.setTitle("Please select an option");
          alert.show();
  
      }
      if(view.getId() == R.id.BTNInfo){
  
      }
      if(view.getId() == R.id.BTNClose){
          finish();
          System.exit(0);
      }
  }
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  }
  </code></pre>
  
  <p>}</p>