**最近在做一个跟蓝牙相关的项目,碰到华为手机搜索不出蓝牙设备的情况,程序不走onLeScan方法的回调,后来才发现,在申请定位权限的时候,需要同时申请
android.permission.ACCESS_FINE_LOCATION,android.permission.ACCESS_COARSE_LOCATION
才能成功,好坑
//请求权限
@Permission(value = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION},
requestCode = REQUEST_PERMISSION_LOCATION,
rationale = "需要蓝牙相关权限")
public void requestPermission() {
checkBlueStatus();
}