Try this in your Activity code:
@Override
public boolean onKeyDown( int keyCode, KeyEvent event )
{
// your key event
if ( event.getKeyCode() == KeyEvent.KEYCODE_SEARCH )
{
// Catch the search
// do something
// return true to consume press or false to pass it on
}
return super.onKeyDown( keyCode, event );
}
On Jan 8, 4:10 pm, Dhaval Varia <[email protected]> wrote:
> i know dear.
> i requied to create broadcaat receiver rinning in bkground.
> bt i dnt know....how to monitor key press..
> that i wnt to know...
> thanks for quick reply...
> On Jan 8, 2012 4:36 PM, "Robinns" <[email protected]> wrote:
>
>
>
>
>
>
>
> > Wow, i dont think you can do that at an application level.
> > May be i am wrong? but as with my little knowledge in Android its not
> > possible at application level.
>
> > On Sun, Jan 8, 2012 at 4:47 PM, Dhaval Varia <[email protected]>wrote:
>
> >> dear
> >> i am making one application.
>
> >> where i required to fire an application without unlocking or selecting
> >> icon of app.
>
> >> i need to trigger app by pressing any of the hardware key(which ever is
> >> possible) of my phone 3 times.
>
> >> plz provide me some code anippet.
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.>> To post to this group, send email
> >> [email protected]
> >> To unsubscribe from this group, send email
> >> to>>[email protected]
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Robin
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.> To post to this group, send email
> > [email protected]
> > To unsubscribe from this group, send email
> > to>[email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en