Files
sensTools/android
茂之钳 2b0d46440c
Build APK / build (push) Failing after 3s
fix: crash on startup - startForeground requires started Service
Root cause: Service created via BIND_AUTO_CREATE (bound-only) is not
in a 'started' state, so calling startForeground throws
IllegalStateException on Android 12+.

Fix: in onServiceConnected callback, call startService() first to
transition the Service into started state, then startCollection()
which calls startForeground().

This is safe because:
- startService on an already-created Service only triggers onStartCommand
- No duplicate creation, no infinite loop
- Matches what v1.0.0 did (startService + call startCollection from Fragment)
2026-05-27 06:36:23 +00:00
..