title: Mark current location on google map
body: <p>How to mark my current location on google map?</p>
  
  <p>I am using google place API. I have to show all near places from my current position. All places are showing on google map, but how to show my current position? 
  The code is given below:</p>
  
  <pre><code>public class PoliceStationMapActivity extends FragmentActivity implements LocationListener {
      private ArrayList&lt;Place&gt; mArrayListPoliceStations;
      private GoogleMap mMap;
      private LocationManager locManager;
      private double latitude;
      private double longitude;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_view_police_station);
  
      locManager = (LocationManager) getSystemService(LOCATION_SERVICE);
      if (locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER))
          locManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
      else
          Log.i("Test", "network provider unavailable");
  
      Location lastKnownLocation = locManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
  
      latitude = lastKnownLocation.getLatitude();
      longitude = lastKnownLocation.getLongitude();
  
      if (lastKnownLocation != null) {
          Log.i("Test", lastKnownLocation.getLatitude() + ", " + lastKnownLocation.getLongitude());
          locManager.removeUpdates(this);
      }
  
      mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
      if (mMap != null) {
          new GetAllPoliceStationsTask().execute("" + latitude, "" + longitude);
      }
  }
  
  private class GetAllPoliceStationsTask extends AsyncTask&lt;String, Void, ArrayList&lt;Place&gt;&gt; {
      @Override
      protected ArrayList&lt;Place&gt; doInBackground(String... param) {
          ArrayList&lt;Place&gt; policeStationsList = RequestHandler.getInstance(PoliceStationMapActivity.this).getAllPlaces(param[0], param[1]);
          return policeStationsList;
      }
  
      @Override
      protected void onPostExecute(java.util.ArrayList&lt;Place&gt; result) {
          if (result != null) {
              mArrayListPoliceStations = result;
              placeAllPoliceStationMarkersOnMap(mArrayListPoliceStations);
          }
      }
  
  }
  
  private void placeAllPoliceStationMarkersOnMap(ArrayList&lt;Place&gt; policeStationList) {
      for (Place place : policeStationList) {
          addPlaceMarkerOnMap(place);
      }
  };
  
  private void addPlaceMarkerOnMap(Place place) {
      LatLng latLng = new LatLng(place.getLatitude(), place.getLongitude());
      Marker poiMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(place.getName()).snippet(place.getVicinity()));
      Marker currentMarker = mMap.addMarker(new MarkerOptions().position());
  }
  
  @Override
  public void onLocationChanged(Location location) {
      latitude = location.getLatitude();
      longitude = location.getLongitude();
  }
  
  @Override
  public void onProviderDisabled(String provider) {
  
  }
  
  @Override
  public void onProviderEnabled(String provider) {
  
  }
  
  @Override
  public void onStatusChanged(String provider, int status, Bundle extras) {
  
  }`
  </code></pre>