Closed prapkengr closed 5 years ago
How does this behavior differ than what you expect, or think it should be?
How does this behavior differ than what you expect, or think it should be?
I followed the comment (Beacon sample) .. says
// Set the two identifiers below to null to detect any beacon regardless of identifiers
So,
Identifier myBeaconNamespaceId = Identifier.parse(null);
Identifier myBeaconInstanceId = Identifier.parse(null);
And it crashes on the app run, saying,
NullPointerException: Identifiers cannot be constructed from null pointers but "stringValue" is null.
But, Yes, of course, then, now, I found identifiers to be parsed. There is no issue for me to do it with identifiers.
Only point is .. the purpose of "Set the two identifiers below to null to detect any beacon regardless of identifiers" is not served.
Are you referring to the docs on this page?
https://altbeacon.github.io/android-beacon-library/eddystone-how-to.html
// Set the two identifiers below to null to detect any beacon regardless of identifiers
Identifier myBeaconNamespaceId = Identifier.parse("0x2f234454f4911ba9ffa6");
Identifier myBeaconInstanceId = Identifier.parse("0x000000000001");
Region region = new Region("my-beacon-region", myBeaconNamespaceId, myBeaconInstanceId, null);
If so, then the correct way to set the identifiers to null is like this:
Region region = new Region("my-beacon-region", null, null, null);
Note you just pass null values for Identifier
in the Region
constructor. There is no reason to use the Identifier.parse
method, which indeed throws an exception if you pass a null value.
Region region = new Region("my-beacon-region", null, null, null);
Perfect. Thanks !
From Beacon example ..
and so if I set
Because, there is