How can I detect more than one UUID of iBeacon source in Application class?

StackOverflow https://stackoverflow.com/questions/22368969

  •  13-06-2023
  •  | 
  •  

質問

Using the pro library,

Region region = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion",
                "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6", null, null);
        regionBootstrap = new RegionBootstrap(this, region);  

It can only accept one UUID.
But if I want to detect more UUIDs, what can I do?

役に立ちましたか?

解決

There is an alternate constructor that lets you pass a list of Region objects. Try this code:

Region region1 = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion1",
            "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6", null, null);
Region region2 = new Region("com.radiusnetworks.androidproximityreference.backgroundRegion2",
            "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0", null, null);
ArrayList regionList = new ArrayList<Region>();
regionList.add(region1);
regionList.add(region2);
regionBootstrap = new RegionBootstrap(this, regionList);  

See javadocs here.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top