Comments (5)
Good catch. The issue is that the serviceMessenger is not set to null when the service disconnects, so the isBound() method returns the wrong value.
Fixed in beecedf
from android-beacon-library.
It sounds like onServiceDisconnected may only be called in the event of the service crashing. I cloned the latest commit and it does not seem to be called when I go through the normal unbinding process.
It seems like an alternate solution will be necessary.
from android-beacon-library.
If there is no callback in the service when the last consumer unbinds, then I suppose it would be possible to track it simply by the number of consumers. Perhaps in the unbind method, we could simply change:
consumers.remove(consumer);
to
consumers.remove(consumer);
if (consumers.size() == 0) {
// If this is the last consumer to disconnect, the service will exit
// release the serviceMessenger.
serviceMessenger = null;
}
@sjones512, since you clearly have a test case queued up, do you want to give this a try?
from android-beacon-library.
This appears to work. The next time getInstanceForApplication is called in onCreate the serviceMessenger is null and isBound returns False.
from android-beacon-library.
Changed in 2b0d4ed
from android-beacon-library.
Related Issues (20)
- Feature Request: Variable scan cycle time in CycledLeScanner HOT 8
- disable foreground service scanning HOT 2
- Android 13 Crash : Beacon service crash HOT 8
- Gatt connections leak if app crashes HOT 6
- Upgrade from 2.19.5 to 2.19.6 - Error: Unsupported class file major version 61 HOT 1
- BLE Beacon scanning when app is killed HOT 1
- Stop detecting iBeacons when app is terminated after 30 minutes HOT 2
- RangedBeacon getFilter() HOT 13
- NPE crash in latest version (2.20.1) in StartupBroadcastReceiver HOT 1
- Range beacons when app is terminating HOT 7
- Beacons ranging not working on android 13 HOT 1
- App stops scanning right after screen is locked and starts giving the results right after unlocked HOT 1
- Android beacon library - multiple regions monitoring - unable remove regions HOT 2
- startForeground Exception when app is not in foreground HOT 3
- StartupBroadcastReceiver throws NullPointerException HOT 2
- No beacons after locked screen HOT 21
- Cannot parse iBeacons HOT 3
- BeaconService.startForegroundIfConfigured HOT 12
- TargetSdk 34 (android 14) Beacon foreground service no longer working due to new Google restriction HOT 1
- Do we have sample app to implement the library including the operation running in Background HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-beacon-library.