Skip to content

Instantly share code, notes, and snippets.

@pranayairan
Created August 13, 2017 18:27
Show Gist options
  • Select an option

  • Save pranayairan/28ff41e02ecc8796bb7a53e4ee5c47e2 to your computer and use it in GitHub Desktop.

Select an option

Save pranayairan/28ff41e02ecc8796bb7a53e4ee5c47e2 to your computer and use it in GitHub Desktop.
Simple code for RXPermission to get location
rxPermissions.request(Manifest.permission.ACCESS_FINE_LOCATION)
.subscribe(new Consumer<Boolean>() {
@Override
public void accept(@NonNull Boolean locationPermissionGranted) throws Exception {
// if location permission is granted query the api
if (locationPermissionGranted) {
} else {
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment