×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    44

    How to detect options soft key is pressed?

    Hi All,
    I have an application which uses List. In which i want to have different set of commands for different users which i am showing in list....

    How I can do that?

    One option i thought is to write event when "option" soft key is pressed..

    How to go ahead?

    Any Help !!!

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

    Re: How to detect options soft key is pressed?

    You cannot do this.

    If you use a Form, you can attach Commands to each Item. Look at Item.addCommand() and Item.setItemCommandListener(). Note that adding Commands to Items only works on MIDP-2.

    If you want to support MIDP-1, you'd you have to construct your own "List" using a Canvas.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    44

    Re: How to detect options soft key is pressed?

    Thanks for reply...

    I am using List instead of Form and profile is MDIP 2.0..

    So what should i do? Should I add list into form ?
    and then apply Item.setItemCommandListeneer?

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: How to detect options soft key is pressed?

    Hi priteshgajjar,

    you cannot add a List inside a Form. Graham's tip was to replace your List with a Form, with Items added directly to the Form itself.

    A (not perfect) workaround to use a List in this case could be to have a Timer to periodically check which is the selected Item index on your List and, if this changes, to accordingly change the Commands on the List itself.

    Also, if you need a Canvas based list, you can take a look at this Forum Nokia Wiki article:

    http://wiki.forum.nokia.com/index.ph...ist_in_Java_ME

    Pit

Similar Threads

  1. Can a background application detect a key press when keypad is locked??
    By rohanwaugh in forum Symbian User Interface
    Replies: 17
    Last Post: 2009-08-14, 10:20
  2. Midlet freezes until Options key is pressed
    By spm24 in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2009-06-10, 05:44
  3. how detect key Press (dtmf)
    By mohammadyou in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2007-09-18, 18:54
  4. Replies: 2
    Last Post: 2005-09-03, 18:24
  5. soft key bug in 3410 JVM
    By jeep_ in forum Mobile Java General
    Replies: 1
    Last Post: 2002-07-03, 11:25

Posting Permissions

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