title: Using setmylocationenabled method to get latitude and longitude
body: <p>I am using setmylocationenabled() method to get current location.It provides a gps button and when i touch that button it provides current location.But i want to know that is there a way to get latitude and longitude of current location as well when we touch that gps button.
  Any help will be apreciated
  Here is the code</p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  GoogleMap googlemap;
  // latitude and longitude
  double latitude = 28.665710;
  double longitude = 77.125876;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
      MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps ");
  
      if(status!=ConnectionResult.SUCCESS){ 
  
          int requestCode = 10;
          Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
          dialog.show();
  
      }else {             
  
          SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
  
         /* LatLng latLng = new LatLng(13.05241, 80.25082);
          googlemap.addMarker(new MarkerOptions().position(latLng).title("Raj Amal"));*/
          googlemap = fm.getMap();
          googlemap.addMarker(marker);
          CameraPosition cameraPosition = new CameraPosition.Builder().target(
                  new LatLng(latitude, longitude)).zoom(20).build();
  
  googlemap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
  googlemap.setMyLocationEnabled(true);
  </code></pre>