этих permission (может как-то по другому их запрашивать?)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (Build.VERSION.SDK_INT >= 33) {
if (ContextCompat.checkSelfPermission(theContext, Manifest.permission.NEARBY_WIFI_DEVICES) != PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.NEARBY_WIFI_DEVICES}, 8);
}
}
if (ContextCompat.checkSelfPermission(theContext, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.BLUETOOTH_CONNECT}, 5);
}
if (ContextCompat.checkSelfPermission(theContext, Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.BLUETOOTH_SCAN}, 6);
}
if (ContextCompat.checkSelfPermission(theContext, Manifest.permission.BLUETOOTH_ADVERTISE) != PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.BLUETOOTH_ADVERTISE}, 7);
}
/*if (ContextCompat.checkSelfPermission(theContext, Manifest.permission.BLUETOOTH_PRIVILEGED) != PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.BLUETOOTH_PRIVILEGED}, 8);
}*/
}
Они в манифесте указаны?
Обсуждают сегодня