Search code examples
androidservicebroadcastreceiveronkeypress

How to use numberKeyListener to get keyPressEvents from the Android Dialler


Can someone help me to get keypress events from the android dialler. can someone help me with it and should i use number key listener for it? I need my service to fire when the user presses 999 on the dialler.

Im just wondering wether i shud use a service for this or a broadcast reciever because i need the same input while the phone is locked or unlocked

Thank you Regards


Solution

  • you can use android.intent.action.NEW_OUTGOING_CALL to detect the out going number (in your case it is 999) and then you can start your service . follow this link http://androidcookbook.com/Recipe.seam;jsessionid=A2DD7A11C804B7C7646DCA883AA452FC?recipeId=1151