Your code does not show how you set up your region to monitor, but I suspect you set up an all null region like in the sample code:
iBeaconManager.startMonitoringBeaconsInRegion(
new Region("myMonitoringUniqueId", null, null, null));
If this is how you started monitoring, then what you are seeing is entirely expected. The region object you get as a parameter in the didEnterRegion
method has the same field values as the region you passed to the startMonitoringBeaconsInRegion
method. If you constructed your region with the last three parameters being null (proximityUuid, major, minor), that is what you get back.
Why does it work this way? When you start monitoring, you are basically saying "tell me about iBeacons that match these identifiers". The equivalent method call does the same thing on iOS and let's you set null major and minor values, but Android allows you to set the proximityUuid to null as well, effectively saying, "tell me about any iBeacon I see at all".
If you want to see the identifiers of the iBeacons you detect, there are two ways to do so:
Specify the identifiers when you start monitoring:
iBeaconManager.startMonitoringBeaconsInRegion( new Region("myMonitoringUniqueId", "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6", 1, 100));
Also start ranging when you start monitoring. The
didRangeBeaconsInRegion(Collection<IBeacon> iBeacons, Region region)
ranging callback gives you a list of all iBeacons that are seen, with all identifiers populated.
See the example code for more details.