BeaconManager.monitoredRegions shows just one region is being monitored, when BeaconManager.startMonitoring() has been called twice:
beaconManager.startMonitoring(regionA)
Log.d(TAG, "Started observing beacon: ${entity.a}")
beaconManager.startMonitoring(regionB)
Log.d(TAG, "Started observing beacon: ${entity.b}")
Log.i(TAG, "Monitoring regions: ${beaconManager.monitoredRegions}")
The above code produces the following logs:
2021-11-17 14:25:10.804 3918-3918/com.dyson.n620f D/BeaconRepository: Started observing beacon: 58857b49-3560-4152-ad6d-779ec1137f66
2021-11-17 14:25:10.833 3918-3918/com.dyson.n620f D/BeaconRepository: Started observing beacon: 9e3464fd-33e8-45b7-85c2-73d8e159dcd3
2021-11-17 14:25:10.833 3918-3918/com.dyson.n620f I/BeaconRepository: Monitoring regions: [id1: 9e3464fd-33e8-45b7-85c2-73d8e159dcd3 id2: null id3: null]
If beaconManager.startMonitoring(regionA) and beaconManager.startMonitoring(regionB) are swapped, the following logs are given:
2021-11-17 14:29:40.211 4291-4291/com.dyson.n620f D/BeaconRepository: Started observing beacon: 9e3464fd-33e8-45b7-85c2-73d8e159dcd3
2021-11-17 14:29:40.232 4291-4291/com.dyson.n620f D/BeaconRepository: Started observing beacon: 58857b49-3560-4152-ad6d-779ec1137f66
2021-11-17 14:29:40.232 4291-4291/com.dyson.n620f I/BeaconRepository: Monitoring regions: [id1: 58857b49-3560-4152-ad6d-779ec1137f66 id2: null id3: null]
Does anyone understand why this is happening, or what I am miss-understanding? Thank you for your help in advance!