简体   繁体   中英

Android bindService fails on 4.0.4 when device is unplugged from development PC

I have two devices (Samsung Galaxy Tab 10 running 4.0.4 and Nexus 7 running 4.2.1). My application i am writing uses bindService/unbindService a service written within the same application to handle the constant managing of data regardless of activity state. Emulator/devices connected to the PC with USB debugging enabled work as expected. As soon as i unplug the the devices and try to the run the application stand-alone it doesn't error or exit or anything just doesn't bind so my log-in button doesn't work in my application until the bind is complete. This bind never completes and I have no idea why. Has anyone else experienced this?

I am including this for anyone who may run into this situation in the future. In my situation this was failing because the background service was waiting for a debugger thanks to android.os.waitForDebugger() and it was timing out. One line can screw your world up.. I had completely forgot that was in there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM