Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

handle android keypress for button of device

Hi

I want to handle events of android devices buttons (back,home,menu,search).

How can I replace default action of those button with my own functions?

Thanks.

Also. I have an unanswered problem on this topic:
http://developer.appcelerator.com/question/25911/how-to-show-android-optionmenu-in-front-of-webview-object

— asked May 24th 2010 by Farsad Ghaffarian
  • android
  • events
  • handle
0 Comments

4 Answers

  • I know this is an old question. But I was looking for an answer and found that you can listen to window events:
    Titanium.UI.Window-object

    You can listen to android:back as well as android:search. Have a look at the UI.Window link.

    cheers,
    Dan

    — answered March 3rd 2011 by Daniel Tome
    permalink
    0 Comments
  • i also need to catch the back-button event, is this possible at the moment?

    — answered June 6th 2010 by Christian Sigl
    permalink
    0 Comments
  • appcelerator support team said me on helpdesk that they don't currently have a method for doing that but they can look into adding it to the API. It won't make the 1.4.0 release most likely though.

    — answered June 6th 2010 by Farsad Ghaffarian
    permalink
    0 Comments
  • Is there a way to handle key press (right/left/up/down) now in android apps?

    — answered March 15th 2012 by sreejith nair
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.