0

So as the title says, I have a Service which Implements OnKeyListener to receive keys in the background to increment some values in my achievement database.

My problem is onKey isn't being called (the service is being created and started and everything)

http://pastebin.com/ne6mV7zs

Am I going about this the wrong way?

Nexion
  • 423
  • 6
  • 18

1 Answers1

1

Android services are unable to respond to Key Listeners because they have no visible manifestation, they run in the background. If you want more information, have a look at this post:

Is it possible to create an Android Service that listens for hardware key presses?

Community
  • 1
  • 1
kz3
  • 785
  • 2
  • 10
  • 23
  • I'm really just trying to get access to the Home/Menu/Back/Search buttons, I could care less about the rest. Is there anyway to catch those presses? – Nexion Dec 06 '11 at 02:54
  • I'm afraid I'm not too sure, however as far as I know, you cannot. – kz3 Dec 06 '11 at 03:02