×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Red Button on device

    Hi
    how could I manage red button on device?(button for disconnect calls)
    becaouse when my midlet is running,if this button is pressed,my Midlet is exited.without doing some jobs that I want when I exit my App.
    how could set listener for it and another buttons for manage them???

    Thanks for Attention.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Red Button on device

    On most devices you will receive a destroyApp() event when the red button terminates your app.

    Be careful not to do anything too time consuming in destroyApp()... it is an event-handler method and, like all event handlers, it should return as quickly as possible.

    Graham.

  3. #3
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Red Button on device

    For S60 3ed FP2 devices onwards you can use the folliwing jad/manifest attribute.

    Code:
    Nokia-MIDlet-No-Exit: true

    Prevents the MIDlet from closing via pressing the End key. Instead of closing the MIDlet it is put to the background. The MIDlet can be still closed from the list of open applications.
    possible values are true or false
    :Ruben

  4. #4
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Re: Red Button on device

    Thanks for your replies,
    how I could receive event of pressing keys such end key,call key,and joystick key?
    is there any solution to manage them??

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Red Button on device

    You cannot receive an event from the end (red) key.

    Most LCDUI Displayable components handle input for you (usually, using the direction pad for navigation, and softkeys to trigger Command objects through the CommandListener interface).

    If you want lower-level access to key events, you need to use CustomItem (which can be added to a Form), or Canvas. For example, if you create a subclass of Canvas, you can override the keyPressed() method to get key input. This will always give you access to 0-9, * and # keys. Access to other keys is dependent on the device. On some devices, certain keys are accessible only in certain conditions (for example, softkeys might generate keyPressed() events only in fullscreen mode).

    You should perhaps take a look on Google for some introductions to MIDP Java development.

    Graham.

Similar Threads

  1. How to capture the Menu and Red button Events??? Pls help.....
    By chandrashekar@nexG in forum General Development Questions
    Replies: 1
    Last Post: 2009-01-09, 18:10
  2. saving game status after press the red end button
    By ayanir in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-16, 16:07
  3. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 06:26
  4. Storing RMS data upon exit via red button on 7210
    By skarsten in forum Mobile Java General
    Replies: 0
    Last Post: 2003-11-04, 23:55
  5. How to avoid MIDlet termination after pressing the red hang-up button
    By adrian_lenhardt in forum Mobile Java General
    Replies: 1
    Last Post: 2003-08-22, 09:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×