Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Detect volume keys when screen is turned off

 
Rohit Savant
Greenhorn
Posts: 21
Fedora Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to perform some action when I press the volume keys. I can listen to them when the screen is on. However I also want to listen to them when the screen is turned off as well. I tried using wakelock, but it didnt work. Is there any way to get this done? Please let me know.
Thakyou for your support in advance. !
 
Ron McLeod
Bartender
Pie
Posts: 1049
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Activities don't run when the screen is off -- you will need to put that functionality in to a Service component instead.

http://developer.android.com/reference/android/app/Service.html
 
Rohit Savant
Greenhorn
Posts: 21
Fedora Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Thankyou. I will try it and will let you know whether it workedm for me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic