04-27-2013 10:09 AM
I want to pop to home screen from my fifth screen, where I have a button which takes to home
I have refered this link
and have put same code, but application hangs, but does not crashes.
any help on how to implement Pop Screen will be really grateful.
Solved! Go to Solution.
04-27-2013 03:07 PM
If you use the code supplied (see later), all your screens will be popped off the display stack, leaving nothing there. What happens then depends on the application, but usually it will either close or hang with no screen displayed. I think you are seeing the later.
If you want to show the user the home screen, but still retain the screen stack you have, then just use
This is effectively the same as the user using the task switcher to switch to the home screen.
If you use this, then, when the user selects your icon again, they will be returned to the screen that they were on before the 'requestBackground()' was issued.
If this is not what you want, please can you describe what you would actually like to happen.
Popscreen code from stackoverflow Thread:
public static void popupScreens()
int screenCount = UiApplication.getUiApplication().getScreenCount();
for (int i = 0; i < screenCount; i++)
Screen screen = UiApplication.getUiApplication().getActiveScreen()
04-29-2013 12:54 PM - edited 04-30-2013 04:10 AM
According to your first post, you wanted to do this:
"I want to pop to home screen from my fifth screen"
How did it help you do this?
Ah, I see, the link you supplied was talking about Esc, but also referenced another response here:
That link did not delete all the screens off the stack, it just deleted all bar 1. This will not take you back the Home Screen, but it will not fail the way that the code you originally supplied will, becuase it leaves one screen on the stack.
For the record, the code is as follows:
UiApplication app =UiApplication.getUiApplication();