mrmans0n / smart-location-lib

Android library project that lets you manage the location updates to be as painless as possible
1.65k stars 353 forks source link

ChecklocationSettings alway false , Cannot call google dialog location #230

Open ult3mate opened 6 years ago

ult3mate commented 6 years ago

checkLocationSettings alway false

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

please fix this.

Ornolfr commented 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.

shantanu1227 commented 6 years ago

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);

MHKalantarian commented 6 years ago
    @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