Thanks Erel for your reply, but I have already inserted what you suggest.
The problems are mainly two:
1) the manager.scan2() doesn't work if in the first parameter I put a uuid (among other things which uuid should I put if I have to scan beacons?)
2) if I press the power button once to turn off the screen, the scan stops
I read in the documentation that to continue scanning with the display off it is necessary, from version 8+, to run a filter, but what can I do if the filter doesn't work?
Thanks for your patience