Cannot resolve Manifest.permission.ACCESS_FINE_LOCATION

前端 未结 12 999
天涯浪人
天涯浪人 2020-12-04 23:13

When adding permissions to my manifest file, the below xml works.

 
12条回答
  •  一向
    一向 (楼主)
    2020-12-05 00:07

    Try this before running, make sure you have permission to access..

    try {
        location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    } catch (SecurityException e) {
       dialogGPS(this.getContext()); // lets the user know there is a problem with the gps
    }
    

提交回复
热议问题