1

I'm doing an android app that has a media player working on notifications as a service , and I want to be able to mute/stop that service, When the phone is turned over or the screen is covered.

Can anyone give me pointers how to implement This, many thanks.

1 Answers1

0

You need to use ProximitySensor to detect when the phone screen is covered. Here is an example: Using proximity sensor in android

Community
  • 1
  • 1
jonathanrz
  • 4,206
  • 6
  • 35
  • 58