title: Current location on Google Map
body: <p>I have called <code>setMyLocationEnabled(true)</code> but it does not show my current location. Please advise. </p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback
  {
      private GoogleMap mMap;
      /**
       * ATTENTION: This was auto-generated to implement the App Indexing API.
       * See https://g.co/AppIndexing/AndroidStudio for more information.
       */
      private GoogleApiClient client;
  
      @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);
          // ATTENTION: This was auto-generated to implement the App Indexing API.
          // See https://g.co/AppIndexing/AndroidStudio for more information.
          client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
      }
  
  
      /**
       * Manipulates the map once available.
       * This callback is triggered when the map is ready to be used.
       * This is where we can add markers or lines, add listeners or move the camera. In this case,
       * we just add a marker near Sydney, Australia.
       * If Google Play services is not installed on the device, the user will be prompted to install
       * it inside the SupportMapFragment. This method will only be triggered once the user has
       * installed Google Play services and returned to the app.
       */
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
  
          // Add a marker in Sydney and move the camera
          LatLng sydney = new LatLng(-34, 151);
          mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
          mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
  
          if (mMap.isMyLocationEnabled()) {
              mMap.setMyLocationEnabled(true);
          } else {
              showSettingsAlert();
          }
      }
  
      private void showSettingsAlert() {
          AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
          alertDialog.setTitle("GPS is settings");
          alertDialog.setMessage("GPS is not enalbled. Do you want to go to settings menu?");
          alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                  startActivity(intent);
              }
          });
  
          alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  dialog.cancel();
              }
          });
          alertDialog.show();
      }
  }
  </code></pre>
  
  <p><strong>Manifest</strong></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  </code></pre>
  
  <p>error</p>
  
  <pre><code> FATAL EXCEPTION: main
                                                             Process: com.companero, PID: 25005
                                                             java.lang.IllegalStateException: MyLocation layer not enabled
                                                                 at maps.f.g.b(Unknown Source)
                                                                 at maps.ag.t.j(Unknown Source)
                                                                 at uz.onTransact(:com.google.android.gms.DynamiteModulesB:281)
                                                                 at android.os.Binder.transact(Binder.java:387)
                                                                 at com.google.android.gms.maps.internal.IGoogleMapDelegate$zza$zza.getMyLocation(Unknown Source)
                                                                 at com.google.android.gms.maps.GoogleMap.getMyLocation(Unknown Source)
  </code></pre>
  
  <p>Thanks a lot!</p>