Can service receive the key event by indirectly?

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Can service receive the key event by indirectly?

Postby ausmus » Mon Jan 26, 2009 4:40 pm

Dear All,

As I know , the service runs in background and can't receive the on key down event.
I want to run a service in background and when user trigger key event then show a alert dialog "some service was running".
How can I make a service to get the key event when some key event occur by indirectly approach?
ausmus
Freshman
Freshman
 
Posts: 3
Joined: Wed Oct 01, 2008 7:44 am

Top

Postby MrSnowflake » Mon Jan 26, 2009 5:16 pm

You can't!
But what you could do: You could have your activity startService() with an intent that has an extra like "ShowVersion" or something like that and if the Service finds this, it'll display the dialog.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to General

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests