04-16-2009 07:14 AM
To amplify a bit on mantaker's responses.
The display stack is the stack of screens you have pushed. Let us say you have these screens in your applications:
A - Home Screen - this is the initial screen you start with and it displays a list of the current items
B - Options Screen - this displays options for the application
C - Detail screen - this displays details for the item the user has selected from Screen A.
Now say your user is in the Home Screen, they have one screen on the stack.
Then they select Options from the Menu, in the menu processing you push the Options screen. Now you have two screens on the stack, the Options Screen and under it the Home Screen. Once the user has changed any options they wish to change they will 'save' and in the save processing, you will pop the Options screen. Now the Home Screen, which was there all the time but hidden, is displayed.
Now they select an item and use the Menu to get Details for that item, in your menu processing you push the Detail screen. On the stack now they have 2 screens, the Home Screen and the Detail Screen. Once they have finished with the Detail screen, they will press ESC or use the Close menu item you have provided. This processing will pop the Detail Screen and the Home screen is displayed again.
Does this make sense. Do you see how push and pop work for screens now?
04-16-2009 08:33 AM
Peter and 'Mantaker'
Thanx for this guidence....
I understand this what u described...
But truly says I made my app little clumpsy because I am calling number of Sub Screens from my MENU in application and after going
thru these MENU Sub Screens I m again calling HOME screen .....
I think doing in this way my Sub Screens are still there in display stack UNDER Home Screen
Now I will try to follow ur steps.
Thnx to u...
05-27-2010 03:56 PM - edited 05-27-2010 04:03 PM
If you have the same example, a Home screen, and a subscreen that processes data as it lays itself out and paints itself, and you want to go back to the HomeScreen, can you do
I got a RuntimeException when I tried to do this. Before I was creating a new Instance of the home screen, which is probably really poor implementation:
Also, where do you ovveride this? in onClose()? The default close() method doesn't pop the screen?
05-27-2010 07:48 PM
This is a solved Thread, if you have a new question best to ask it in a new Thread.
UiApplication.getUiApplication().pushScreen(getScr eenBelow)); will never work. The Screen is already on the Display stack. You are asking it to be in two places on the Display Stack. If it is the screen below, then popping the current screen will display it.
I thought the default close() did in fact pop the screen. I usually override it so I'm not 100% sure but that is what I thought. Certainly for MainScreen I'm pretty sure.
05-28-2010 12:07 PM - edited 05-28-2010 12:31 PM
Can I make a screen a singleton? and then push it, even if its already on the stack somewhere? Do you pop the mainscreen before pushing another?
Here is what I mean
A -> B -> C
A -> B
A <- B
When I go from A to B, I push B. When I go from B to C, I push C. When I leave C, I pop it. but when I leave B, I do not want to pop it, nor do I want to push a new A(). so can I push(A.getInstance())
Or do I have to pop A when I push B in order to keep B running and go back to A?
Sorry I'll start a new Thread.
02-16-2011 08:18 AM
The above solution is not working for me. I have an app which has 3 Java files in the same package
FirstScreen.java and SecondScreen.java implement FieldChangeLIstener interface and extend MainScreen class.
I have used UiApplication.getUiApplication().popScreen(this); in SecondScreen.java to go back to First Screen. But it isn't working. What am i doing wrong?
Help asap please!
02-16-2011 09:13 AM
As this is a Solved Thread, you are better raising this as a new problem on a new Thread. However when you do, please can you be a little more explicit that 'it isn't working. Can you describe exactly what you do, what you see and what you expect to see. Some code snippets might be useful too.