0

Can we get listener of screen off gesture in our app?

Like i want to make call to particular contact or send message on gesture of some sign while screen is off. Is it possible?

  • 3
    The touchscreen is disabled on most devices when the screen is off. – CommonsWare Apr 17 '17 at 12:10
  • You possibly can create a total black activity and [reduce the brightness](http://stackoverflow.com/a/18312812/6548766) to make it look like the screen is off. – Jackie Degl'Innocenti Apr 17 '17 at 12:12
  • @JackD No, i want to get the listener while screen is actually off. like in-built functionality of some devices, draw "V" and turn on flash light – Sonal Bharwani Apr 17 '17 at 12:17
  • So have a look at [this](http://stackoverflow.com/a/16434558/6548766) – Jackie Degl'Innocenti Apr 17 '17 at 12:56
  • @JackD I think this is not duplicate. As per my understanding he is asking for gesture when screen is locked similar to devices' music player, we are changing songs when screen is locked not when screen is off. – Sonal Bharwani Apr 18 '17 at 04:39
  • Sorry, my fault. By the way this is duplicate of many others: see [this](http://stackoverflow.com/questions/21112375/detect-gesture-with-phone-sleeping) and [this](http://stackoverflow.com/questions/21572750/touch-event-while-display-off). It seems that the only choice you have is to hook to the power button, because, as @CommonsWare and many other said, the touchscreen if off as the sceen is off. – Jackie Degl'Innocenti Apr 18 '17 at 11:06
  • yeah it seems so, No other option. And thanks for answering @JackD – Sonal Bharwani Apr 18 '17 at 12:55

0 Answers0