Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings dialog is not showing! #237

Open
khaledkhj opened this issue Mar 31, 2018 · 2 comments
Open

Settings dialog is not showing! #237

khaledkhj opened this issue Mar 31, 2018 · 2 comments

Comments

@khaledkhj
Copy link

khaledkhj commented Mar 31, 2018

Thanks for the great work on this library!

There still this issue here, the settings dialog is not showing if the GPS is OFF!
I am not sure if it is related to Android OS version!

Anyway,
Android OS is 8.0.0

here is my code
provider = new LocationGooglePlayServicesProvider(); provider.setCheckLocationSettings(true); provider.setLocationSettingsAlwaysShow(true); provider.init(this, LoggerFactory.buildLogger(true));

Thank you.

@jatin-lakhani
Copy link

+1
Having the same issue. Any solution will greatly be appreciated!

@RazibKani
Copy link

Basically you can not show Location Settings if not init SmartLocation using Activity Context, because the Dialog only show if context is instance of Activity as shown below..

if (context instanceof Activity) { try { // Show the dialog by calling startResolutionForResult(), and check the result // in onActivityResult(). status.startResolutionForResult((Activity) context, REQUEST_CHECK_SETTINGS); } catch (IntentSender.SendIntentException e) { logger.i("PendingIntent unable to execute request."); } } else { logger.w("Provided context is not the context of an activity, therefore we can't launch the resolution activity."); }

This snippet from
https://github.com/mrmans0n/smart-location-lib/blob/master/library/src/main/java/io/nlopez/smartlocation/location/providers/LocationGooglePlayServicesProvider.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants