Sometimes cannot ranging beacon

I got a problem that sometimes I can’t ranging my beacons in my android application. Until I turn off my bluetooth and open it again. Then I can ranging my beacons. It won’t happen everytime.

It looks like a phone issue. If your app stopped to range beacons and you restarted it, this would mean that issue is in the app. But when you need to restart Bluetooth to enable scanning it suggests that there can be a bug in Bluetooth stack.
Can verify it the same happens for nRFConnect? What phone model it is? What Android version it is using? There are some known issue with some devices.

I use InFocus m510 for test, android version 4.4.2.
I tried to verify the same problem and use nRFConnect to scan my beacon, but it also can’t find any device, too.

If it is not working in other apps this means that problem is in the phone. You need to contact manufacturer and get some firmware updates. Pre-5.0 Androids had a lot of problems with Bluetooth. This would also explain connectivity problems (Error 257).

Unfortunately, InFocus m510 can’t be update to android 5, otherwise I will update it. Because I need android 5 to test other things.