08-02-2010 04:34 AM
Hope the subject is not misleading. I have an application that relies on pushing a lot of differnet screens. This i am able to do with no problem. The problem is when the user uses the "back button" on his/her BB. This takes the user to the previous "Old" Screen with old data. I want to know what is the right way to manage pushing screens.
User starts app, mainscreen is launched,
User clicks add button pushes screen to new screen and adds vehicle,
i pushscreen to mainscreen after added.
Now when user presses back button it take the user to the add screen with all the input still there.
I don't want this i want that screen to be removed from the heap or stack or memory or where ever it is stored.
Thanks in advance for the help guys.
Solved! Go to Solution.
08-02-2010 04:42 AM
08-02-2010 04:57 AM
Hi, After pushing screen for adding.
08-02-2010 05:02 AM
Getting Illegal argument exception, This is on a custom Dialog box that confirms the delete then once clicked ok takes user back to the main screen.
08-02-2010 05:11 AM - edited 08-02-2010 05:13 AM
what i understud u can do :
you can pop a screen before moving to a new screen and when user presses back button u can again push ur older screen with new data by overriding onClose method()
hey sorry for repeating data mentioned by others
08-02-2010 05:11 AM
on the Add Click,
Dont push back your mainscreen,
Write this code..it will bring you back to mainscreen.
MainScreen ---> AddScreen
Finally you will have the mainscreen
08-02-2010 05:14 AM
User starts app, mainscreen is launched - Ok
User clicks add button pushes screen to new screen and adds vehicle - pushscreen
i pushscreen to mainscreen after added - Don't push screen here, merely pop the current screen.
08-02-2010 05:16 AM
you are right.
08-02-2010 05:26 AM
I have tried it and it works 80%, it is just a matter of getting the popping and pushing sequence write now
Will mark Ekansh as solution as i used his code to get it working.