I'm writing an Android App custom Class that utilises AltBeacon's Android-Beacon-Library. But when first start, If I'm in the beacon region, the didEnterRegion() won't work. I want to create an event right away. I can't find any other solution. Plz, Any help appreciated! This is my code ▼
beaconManager.addMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
//Log.i(TAG, "I just saw an beacon for the first time!");
sendData(dataStart);
mHandler.post(new Runnable() {
@Override
public void run() {
tv_beacon_.setText("work");
}
});
}
@Override
public void didExitRegion(Region region) {
//Log.i(TAG, "I no longer see an beacon");
sendData(dataEnd);
mHandler.post(new Runnable() {
@Override
public void run() {
tv_beacon_.setText("not work");
}
});
}
@Override
public void didDetermineStateForRegion(int state, Region region) {
Log.i(TAG, "I have just switched from seeing/not seeing beacons: "+state);
}