I fixed the context as you suggested, using MainActivity.this to make sure I have the right scope. The run behavior is unchanged. Here's what appears in logcat. It looks like some sort of timeout when trying to start the service.
W/InputManagerService( 52): Got RemoteException sending setActive(false) notification to pid 4041 uid 10024 I/ActivityManager( 52): Displayed activity com.shipmate/.MainActivity: 5999 ms (total 5999 ms) D/dalvikvm( 101): GC freed 167 objects / 7248 bytes in 109ms W/ActivityManager( 52): Timeout executing service: ServiceRecord{43cf1c40 com.shipmate/.SensorService} I/ActivityManager( 52): ANR in process: com.shipmate I/ActivityManager( 52): Annotation: Executing service ComponentInfo{com.shipmate/com.shipmate.SensorService} I/ActivityManager( 52): CPU usage: I/ActivityManager( 52): Load: 0.27 / 1.05 / 0.98 I/ActivityManager( 52): CPU usage from 36474ms to 74ms ago: I/ActivityManager( 52): system_server: 7% = 6% user + 1% kernel / faults: 744 minor I/ActivityManager( 52): adbd: 4% = 0% user + 3% kernel I/ActivityManager( 52): d.process.acore: 1% = 0% user + 0% kernel / faults: 287 minor I/ActivityManager( 52): m.android.phone: 0% = 0% user + 0% kernel / faults: 1 minor I/ActivityManager( 52): utmethod.pinyin: 0% = 0% user + 0% kernel I/ActivityManager( 52): logcat: 0% = 0% user + 0% kernel I/ActivityManager( 52): zygote: 0% = 0% user + 0% kernel / faults: 17 minor I/ActivityManager( 52): qemud: 0% = 0% user + 0% kernel I/ActivityManager( 52): servicemanager: 0% = 0% user + 0% kernel I/ActivityManager( 52): logcat: 0% = 0% user + 0% kernel I/ActivityManager( 52): +com.shipmate: 0% = 0% user + 0% kernel I/ActivityManager( 52): +sh: 0% = 0% user + 0% kernel I/ActivityManager( 52): +app_process: 0% = 0% user + 0% kernel I/ActivityManager( 52): -com.shipmate: 0% = 0% user + 0% kernel I/ActivityManager( 52): TOTAL: 20% = 12% user + 6% kernel + 0% irq + 0% softirq I/ActivityManager( 52): Removing old ANR trace file from /data/anr/ traces.txt -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en