Closed pbrewczynski closed 10 years ago
In your quick example you have:
// Should be invoked in #onCreate. BeaconManager beaconManager = new BeaconManager(context); beaconManager.setRangingListener(new BeaconManager.RangingListener() { @Override public void onBeaconsDiscovered(Region region, List<Beacon> beacons) { Log.d(TAG, "Ranged beacons: " + beacons); } });
Next part assume beaconManager is instance variable of that class, but it isn't.
// Should be invoked in #onStart. beaconManager.connect(new BeaconManager.ServiceReadyCallback() { @Override public void onServiceReady() { try { beaconManager.startRanging(ALL_ESTIMOTE_BEACONS); } catch (RemoteException e) { Log.e(TAG, "Cannot start ranging", e); } } });
Shouldn't beaconManager be instance variable ?
That is:
private BeaconManager beaconManager;
Obviously yes.
In your quick example you have:
Next part assume beaconManager is instance variable of that class, but it isn't.
Shouldn't beaconManager be instance variable ?
That is: