×

Discussion Board

Results 1 to 6 of 6

Thread: Back command

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    14

    Back command

    hi!!

    i am trying to make a back command for my mobile application.
    the interface is fine but i am stuck at how to link the current form back to the previous screen. can anyone pls help?

    thanx in advance

    reguards,

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    There are many ways to do that. The best way I've seen is to implement a "Displayable stack", or DisplayManager class. Every time you want to load a new screen, you ask the DisplayManager to do it, and it will also add this screen to a stack of Displayables it has. Then when you need to go back you just pop the last Displayable from the stack and voila!

    shmoove

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    LWUIT- adding back command to button

    hello i want to create my own back button. this button will be placed on form, when get clicked it will return to previous form like command button on soft menu.

    how to do that if i'm using lwuit?

  4. #4
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: Back command

    hello shmoove.. can please tell us in more detail (code snippet) on how to use Displayable stack?

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

    Re: Back command

    The stack mentioned is just the built-in Stack class of CLDC. That is a subclass of Vector. Then in your implementation, it is a static class or member of a class. Nothing very special, actually. You push and pop your latest Displayable there.

    However, I go another approach and make the displayable-where-to-go a private callee member of my instance. This way, I do not have to deal with a globally visible stack which could be changed by anyone.

    Both are tricks for LCDUI. But you are in LWUIT, aren’t you?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Back command

    Quote Originally Posted by traud View Post
    Both are tricks for LCDUI. But you are in LWUIT, aren’t you?
    Yes, he is. A post in an other thread is merged here as #3.

Posting Permissions

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