'Facing this issue whenever adding permissions. and what i do code instead on comment lines?

if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED) {

// TODO: Consider calling

//ActivityCompat#requestPermissions

// here to request the missing permissions, and then overriding

// public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)

// to handle the case where the user grants the permission. See the documentation

for ActivityCompat#requestPermissions for more details.

return;

            }



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source