I want to get driver current location in uber clone. When I write this code:
locationRequest=LocationRequest.create(); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationRequest.setInterval(5000); locationRequest.setFastestInterval(1000);
I get the error:
Cannot resolve method ‘create’ in ‘LocationRequest’
And when I write
mLocationRequest=new LocationRequest();
I get this error:
‘LocationRequest()’ has private access in ‘android.location.LocationRequest’
Advertisement
Answer
Use LocationRequest.Builder(long intervalMillis)
instead LocationRequest()
.