Home > Mobile >  LocationManager requestLocationUpdates method to add the permissions, is still an error
LocationManager requestLocationUpdates method to add the permissions, is still an error

Time:10-05

Add the limits of the method, is still an error, ask the great spirit show

When using method

Is still an error

CodePudding user response:

You need to add authentication ContextCompat checkSelfPermission

CodePudding user response:

What is the method?

CodePudding user response:

If (ActivityCompat. CheckSelfPermission (this,
The Manifest. Permission. ACCESS_FINE_LOCATION)==PackageManager. PERMISSION_GRANTED | |
ActivityCompat. CheckSelfPermission (this, the Manifest. Permission. ACCESS_COARSE_LOCATION)==PackageManager. PERMISSION_GRANTED) {
LocationManager. RequestLocationUpdates (provider, 1000, 0, locationListener);//2000,
}


Add authentication, the other requires dynamic application permissions

CodePudding user response:

Dangerous permissions to dynamic applications

CodePudding user response:

You need to add dynamic permissions: Manifest. Permission. ACCESS_FINE_LOCATION
  • Related