08-23-2010 01:59 AM
Hi Guys,
I have a question related to Basics i.e UI Navigation & Stack. I hope the Moderators will show interest in this post.
I have two screens :-
Screen 1 - Grid Main Menu - Main menu where all the elements are present in a grid.
Screen 2 - Display Information Screen - which displays the information like "Data Stored Successfully" etc.
When i am moving from Screen 1 (Grid Main Menu) to Screen 2 (Display Information Screen), i am using the code given below :-
ApplnName.instance().displayinfo = new DisplayInfo("TITLE_SCREEN_NAME"," Data Stored Sucessfully.");
ApplnName.instance().ScreenTransition(ApplnName.in
UiApplication.getUiApplication().pushScreen(ApplnN
Display Info class has a constructor with DisplayInfo(String Title,String Data){ }, where we are pushing Display Info screen.
Now once we are in the Display Info Screen where the information "Data Stored Sucessfully" is shown. Then if we click on the Back Key, Screen Navigation is being handled used the following code :-
protected boolean keyDown(int keycode, int time){
if (Keypad.key(keycode) == Keypad.KEY_ESCAPE){
// Popping the current active screen twice
ApplnName.instance().popCurrentActiveScreen();
UiApplication.getUiApplication().popScreen(UiAppli
// Setting Screen Number
ApplnName.instance().setScreenNumber(ScrNumber.GRI
ApplnName.instance().mainmenu = new GridMainMenu();
ApplnName.instance().ScreenTransition(ApplnName.in
UiApplication.getUiApplication().pushScreen(Appln
clearAllVariables( );
ApplnName.instance().displayinfo = null;
Previously i was not manually handling Back Key, It was automatically handling the screen navigation due to stack. But i read many posts about UI Implementation related to Stack, where they have mentioned that we have to clear the stack as much as possible. So i am clearing the stack twice and controlling the navigation using Screen Numbers.
Is this the correct / efficient way of navigation ?
Can anyone please advise me on this topic ?
Thanks in advance. I request the Moderators to have a look at this topic. If answered correctly, this might help Newbies to learn quickly.
Thanks
Raki
08-23-2010 04:15 AM
Is there a method to clear the entire Stack at once instead of doing it twice ?
ApplnName.instance().popCurrentActiveScreen();
UiApplication.getUiApplication().popScreen(UiAppli
08-23-2010 07:22 AM
Your post will likely have a better chance being answered over in the Java forums. The web forums are mainly for HTML, CSS, JavaScript questions and Browser/Widget specific questions.
Would you like me to move your post for you?