Discussion Board

Results 1 to 6 of 6

Thread: Back command

  1. #1
    Registered User okok7878's Avatar
    Join Date
    Oct 2003
    Posts
    14
    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 shmoove's Avatar
    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 herahadi's Avatar
    Join Date
    Mar 2013
    Posts
    3
    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 herahadi's Avatar
    Join Date
    Mar 2013
    Posts
    3
    hello shmoove.. can please tell us in more detail (code snippet) on how to use Displayable stack?

  5. #5
    Nokia Developer Champion traud's Avatar
    Join Date
    Mar 2003
    Posts
    3,934
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,744
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved