Error 507: Unable to connect. Is the device turned on?

Hi, I creted an app to connected my bluetooth module hc-06 and when I try to use the app the error 507 show up. I don’t know how fix it. I’m using a movil with andrid 9

Please export your project and post it here.

I think it's because you pressed the button to connect, over and over