I'm trying to use MyLocation class from here. In code below I need to access variable currentLat and currentLon anywhere inside the class instantiating MyLocation. I don't know how to access value of currentLat
and currentLon
LocationResult locationResult = new LocationResult(){
@Override
public void gotLocation(Location location){
currentLat = location.getLatitude();
currentLon = location.getLongitude();
};
}
MyLocation myLocation = new MyLocation();
myLocation.getLocation(this, locationResult);
Suppose I want here
Double x =currentLoc;
how to I get that? Any help would be appreciated