Open ult3mate opened 6 years ago
SmartLocation
.with(this)
.location(LocationGooglePlayServicesProvider().apply { setCheckLocationSettings(true) })
.start { }
This should show the dialog. Unfortunately, the location is not fetched after user accepted it.
This will also show the dialog
provider = new LocationGooglePlayServicesProvider(); provider.setLocationSettingsAlwaysShow(true); provider.setCheckLocationSettings(true); provider.init(this, LoggerFactory.buildLogger(true)); provider.start(location -> { provider.stop(); }, LocationParams.NAVIGATION, true);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (provider != null)
provider.onActivityResult(requestCode, resultCode, data);
}
Add this to your code if you want to fetch location after user accepted. @Ornolfr
checkLocationSettings alway false
provider = new LocationGooglePlayServicesProvider(); provider.setCheckLocationSettings(true);
please fix this.