-1

how I can get current GeoPoint from my location. I am on : Longitude: 21.760029 Latitude: 54.035795

But when I use getLatitude(), I have 54.0 but I want 54.035795.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Unmerciful
  • 1,325
  • 4
  • 21
  • 38

1 Answers1

1

Here's a method for converting a latitude, longitude pair to a GeoPoint object:

public static GeoPoint convert(double latitude, double longitude)
{
    int lat = (int)(latitude * 1E6);
    int lng = (int)(longitude * 1E6);

    return new GeoPoint(lat, lng);
}
Adil Hussain
  • 30,049
  • 21
  • 112
  • 147