setRangeNotifier(RangeNotifier) has been deprecated?

北战南征 提交于 2020-04-13 06:59:27

问题


I am using the alt.beacon library and now I get this warning:

warning: [deprecation] setRangeNotifier(RangeNotifier) in BeaconManager has been deprecated.

But what is the replacement? I need to range the beacons from a region and the callback RangeNotifier it crucial to implement this feature.

public interface RangeNotifier {
    void didRangeBeaconsInRegion(Collection<Beacon> var1, Region var2);
}

Anyone has a sample of how the new library is supposed to work?

thx!


回答1:


Starting with version 2.9, you may have more than one RangeNotifier. So instead of calling:

beaconManager.setRangeNotifier(rangeNotifier);

Simply call:

beaconManager.addRangeNotifier(rangeNotifier);


来源:https://stackoverflow.com/questions/38964298/setrangenotifierrangenotifier-has-been-deprecated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!