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,
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,
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
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?
hello shmoove.. can please tell us in more detail (code snippet) on how to use Displayable stack?
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?