×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    how to implement menu pop up on list item long press in J2ME?

    down vote favorite


    I am developing an J2ME application where i have a list. Now i want to display a pop up screen with three menus(delete, details and cancel) when i will make a long press or click on any of the list item / row. I have seen similar type of features in some nokia touch phones(Check the whatsapp application).

    I have tried with below code:

    Code:
     m_lAccountsList.setCommandListener(this);
        m_lAccountsList.setSelectCommand(selection);
    
       public void commandAction(Command c, Displayable d) {
        if(c == selection)
        {
            // I need to implement the pop up menu
        }

    Is this pop menu is possible for j2me? .How i can implement this?
    -chandu.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    682

    Re: how to implement menu pop up on list item long press in J2ME?

    Well it depands on what type of UI your using (LCDUI, LWUIT, CANVAS based)

    From what i see your using LCDUI i suggest you look at com.nokia.mid.ui.gestures package where you can listen for events such as long press.
    For lwuit based apps its different and there is a method you need to override of the component.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: how to implement menu pop up on list item long press in J2ME?

    also LWUIT for S40 has a PopupChoiceGroup Component https://www.developer.nokia.com/Reso...oicegroup.html

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    Re: how to implement menu pop up on list item long press in J2ME?

    Yes i am using lcdui. And i am trying it Nokia N8-00 device. But when i am importing like this:

    import com.nokia.mid.ui.gestures;

    it is giving error: import cannot be resolved
    Last edited by chandu_1233; 2013-05-13 at 10:36.
    -chandu.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    682

    Re: how to implement menu pop up on list item long press in J2ME?

    com.nokia.mid.ui.gestures package is not supported on N8
    It is supported on Nokia java DP 1.1 platform and onward (i'm not sure if DP 1.0 supports this or not) in any case you can test it on any Asha full touch device for sure.

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    Re: how to implement menu pop up on list item long press in J2ME?

    Then how can i make it for all the touch and type Nokia devices? As i told before, i am developing J2ME, not with Nokia SDK.
    -chandu.

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: how to implement menu pop up on list item long press in J2ME?

    Command.ITEM

    Did that answer you question?

    However as usability guy, I highly discourage from doing this because it hides controls and creates a context menu. Such a hidden menu is very uncommon in a graphical user-interface. The user has to search, try and find or fail. Finally, on touch based devices, the user has to tap for a certain amount of time. Nobody knows how long and users re-try. It is different to a mouse gesture in a desktop operating system, where this is one click.

    Furthermore, this does not work in Series 40 Touch-and-Type like the Nokia 303, Series 40 Full-Touch like the Nokia 311, nor in the new Asha UI (Asha-software-platform) like the Nokia 501.

  8. #8
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    Re: how to implement menu pop up on list item long press in J2ME?

    If the Gesture will not work for Nokia N8 devices, what is alternative way to find out the Long press on the List row? Is there any thing in the J2ME API ?
    -chandu.

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    682

    Re: how to implement menu pop up on list item long press in J2ME?

    Chandu: like i wrote to you before if you want you can switch to lwuit based ui which has a longPressed method that you can override for each component and it will act the same way in every Nokia touch based device.

  10. #10
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    Re: how to implement menu pop up on list item long press in J2ME?

    Ok Shai. But is it really not possible for lcdui? And how can i change the lcdui to lwuit UI? Please help.
    -chandu.

  11. #11
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: how to implement menu pop up on list item long press in J2ME?

    As mentioned, Command.ITEM works like a charm.

Similar Threads

  1. Long press on List item
    By mpolovincak in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2011-05-13, 20:59
  2. Replies: 2
    Last Post: 2011-04-19, 08:16
  3. Disable long-press menu
    By rounel in forum Symbian
    Replies: 1
    Last Post: 2010-05-22, 22:04
  4. Long key press event in J2me
    By rajivmodh in forum Mobile Java General
    Replies: 5
    Last Post: 2010-03-23, 06:05
  5. Menu key long press
    By a.alsayed in forum Symbian
    Replies: 5
    Last Post: 2009-10-01, 12:23

Posting Permissions

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