Comprueba si el bluetooth está habilitado usando una aplicación de Android

Quiero verificar si el Bluetooth está habilitado en un dispositivo con una aplicación de Android. Utilicé el método .isEnabled. Pero hay un error. Descubrí (comentando líneas) que el error está en el método .isEnabled. ¿Puede usted por favor ayudarme a resolver esto?

final BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();

submitButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        String status = "Bluetooth";

        if(bluetooth != null) {
            if (bluetooth.isEnabled()) {
                String mydeviceaddress = bluetooth.getAddress();
                String mydevicename = bluetooth.getName();
                status = ("Address "+ mydeviceaddress + " Name" + mydevicename);
                Toast.makeText(getApplicationContext(), "" + status + "", Toast.LENGTH_LONG).show();
            } else {
                status = ("Bluetooth not enabled");
                Toast.makeText(getApplicationContext(), "" + status + "", Toast.LENGTH_LONG).show();
            }
        } else {
            Toast.makeText(getApplicationContext(), "" + status + "", Toast.LENGTH_LONG).show();
        }
    }
}

Respuestas a la pregunta(4)

Su respuesta a la pregunta