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

always gives error ::onPermissionDiened #7

Open
samirmangroliya opened this issue Sep 28, 2017 · 4 comments
Open

always gives error ::onPermissionDiened #7

samirmangroliya opened this issue Sep 28, 2017 · 4 comments

Comments

@samirmangroliya
Copy link

i have given permission but it gives error like.

":onPermissionDiened" in

@OverRide
public void onPermissionDiened() {
Log.d("callback", ":onPermissionDiened");
locationTracker.stopLocationService(getBaseContext());
}

@netodevel
Copy link
Contributor

could you provide an example with the code?

@samirmangroliya
Copy link
Author

  LocationTracker locationTracker;
        if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
                && ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
            Log.d(" is permission granted ", " yes "); // i can see this log in logcat

              locationTracker = new LocationTracker("my.action")
                    .setInterval(1000)
                    .setGps(true)
                    .setNetWork(false)
                    .currentLocation(new CurrentLocationReceiver(new CurrentLocationListener() {

                        @Override
                        public void onCurrentLocation(Location location) {
                            Log.d("callback", ":onCurrentLocation" + location.getLongitude());
                            locationTracker.stopLocationService(getBaseContext());
                        }

                        @Override
                        public void onPermissionDiened() {
                            Log.d("callback", ":onPermissionDiened");
                            locationTracker.stopLocationService(getBaseContext());
                        }
                    })).start(getBaseContext(), MainActivity.this);

        }

@chnouman
Copy link

same error

@irwing844
Copy link

same error x2

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

4 participants