Background service to control proximity sensor
问题 I need to run a service (always in background, I want the service constantly checking even if the application is closed) that control the proximity sensor status, and when it's covered launch an activity. I tried but I had error. Any examples of something like this? P.S. In my AndroidManifest I added: <service android:name="xxx.xxxxx.xxxxx.MyService" android:enabled="true" /> Here my MyService.java: (Eclipse don't report any error but when I try it on my device, apps give a force close.)