4

我得到java.lang.UnsupportedOperationException并且应用程序在以下行崩溃:

this.beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));

这是堆栈跟踪的一部分:

java.lang.UnsupportedOperationException
            at java.util.Collections$UnmodifiableCollection.add(Collections.java:928)
            at com.cc.office.BeaconMonitoring.BeaconMonitoringCoordinator.detectBeaconsUsingMonitorNotifier(BeaconMonitoringCoordinator.java:75)
4

1 回答 1

0

线

this.beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));

被调用后

beaconManager.bind(this);

该问题已通过在绑定之前调用 add 函数得到解决。

于 2015-01-20T11:13:49.440 回答