Error 515. Need help

My setup:
Arduino Uno with HC05 Bluetooth Module
Xiao Mi A2 Lite Phone

I have 2 screens for my app. The first screen was able to connect to the HC05 module and interact with Arduino Uno without any problem. However, when I go to my second screen, the error message "Error 515: Not connected to a Bluetooth device" keeps popping up. My attempted solution was to add the listpicker for my second screen to connect to the Bluetooth module, but the error message still pops up.
Would appreciate some assistance...


Hello Ang Han Quan

Well, it's very simple. Each Screen has it's own separate memory allocation. They are therefore independent of each other, meaning that if Bluetooth is connected on Screen1, Screen2 is not connected.

It is very easy to avoid this issue by using Virtual Screens instead.

When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.

So, instead of separate "houses", virtual screens are "rooms" of the same "house".

To summarize your reply, do I do everything on Screen 1 instead of splitting it into 2 screens?

Yes :upside_down_face:

Thank you so much! Will try it out! :smiley: