App crashing with error 507 when the bluetooth device is off

Hello everyone, I need help regarding a bug on my application. It crashes as soon as I click on it in the listPicker and the bluetooth device is off and error 507 appears. Can you help me please ? THANKS
Bluetooth_screens26_redim_2.aia (823.3 KB)

But what's your problem? You're handling a 507 error, so what's the problem?

My app is crashing when I missclicked on a disabled device so it's really unpleasant... Please have a look the attached record.

It was an example in a compiled app?

It's strange because when I try to connect to a bt module that is turned off, but I have it in the list of paired bt devices, I get this:

What android are you testing it on?

It's really strange because I checked it on another phone and the issue doesn't appear... I'm on Android 13 on a ONEPlue 9 5G.

Android version & device name? Which one is having the problem and which one isn't?

My OnePlus Pro 5G has this problem and a Samsung Galaxy A53 5G hasn't this problem both run with the Android 13 OS.

I found on google information that some OnePlus have a problem with bluetooth connectivity. Manufacturing defect. Maybe you are unlucky and got such a model. Test the app on samsung.

That screen Error Occurred event looks overloaded.

All it should do is notify what the error was, and not make things worse trying to do anything further.

That could lead to a cascade of more errors, then a crash

I took a quick look at your blocks and don't see any permission requests (on Android 12+ / API 31+) like this:


(Did you grant this manually in the app settings?)

Yes, I allowed the application to interact with the nearby devices in the settings oh the phone. But I can add this feature who ask to the user to allow the connection with the nearby devices.

Oh okay.. I already checked on a samsung device and it works.

I just have only one error and it's the 507.

How do you do for requesting to turn on the bluetooth with th bluetooth classic ?

Or you need to use an extension to enable BT without user interaction.