Cannot find devices when I click the button "scan"

I just created a simple app that can scan the BLE devices and connect them. However, it works well when I click the scan button on Screen2 but when I press the image button and go back to the screen 2 again, the scann button doesn't work. I cannot find the devices anymore.


2

My Android version is 5.0, so I think the LOCATION_PERMISSION is not the point.

Switch screens correctly, see also

Taifun

Thank you Taifun. This is helpful.