Not sure what's going on but when I try to call GeoPoint to get my devices current longitude and latitude I get the notification "Cannot resolve symbol 'GeoPoint'. Not quite sure what's going wrong
private void getLastKnownLocation() {
Log.d(TAG, "getLastKnownLocation: called.");
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;
}
mFusedLocationClient.getLastLocation().addOnCompleteListener(new OnCompleteListener<android.location.Location>() {
@Override
public void onComplete(@NonNull Task<android.location.Location> task) {
if (task.isSuccessful()) {
Location location = task.getResult();
GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());
Log.d(TAG, "onComplete: latitude: " + geoPoint.getLatitude());
Log.d(TAG, "onComplete: longitude: " + geoPoint.getLongitude());
}
}
});
}
Try to use the LatLng instead of GeoPoint:
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());