Open New Screen using IR Sensor

Hye, I’m a newbie here. I would like to ask a solution for my code. My project uses 2 IR sensors. When they had a blockage, it will send data for the apps to open a new screen. My Bluetooth connection successfully being connected. But, when I touch one of my sensors, it didn’t work. It didn’t go to the new screen. Anyone can tell me where was the error.

We already told you why you lose connection:

Use “virtual screens” if running bluetooth to maintain connection