mrmans0n/smart-location-lib

ChecklocationSettings alway false , Cannot call google dialog location

ult3mate opened this issue · 3 comments

checkLocationSettings alway false

provider = new LocationGooglePlayServicesProvider();
provider.setCheckLocationSettings(true);

please fix this.

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