 Thread Author
# 1

04-14-2009, 11:53 AM
|
| | CrackBerry Abuser Device(s): 9700 (Bold) Carrier: AT&T/Cingular Pin: 21C3344D | | Location: Ames, IA Join Date: Feb 2009 Posts: 256 Likes Received: 0
Thanked 0 Times in 0 Posts
| |
How to close a screen
So I have an app I'm writing (long time HDL/C/C++ programmer, not so much with the Java) and I have my main screen up (DeviceListScreen). I created a menu item to open a new screen (AddNewDeviceScreen) where the user enters data which will be saved into a list once the user closes this new window. To get this info from AddNewDeviceScreen into my main class's list I have overwritten AddNewDeviceScreen.onClose() to gather the info, put it in the list and then close and go back to DeviceListScreen. This is the issue.
I know this isnt exactly how the code looks but this is the idea.
MenuItem m_AddDeviceItem = new MenuItem(...)
{
void run()
{
DeviceListScreen dls = new DeviceListScreen();
UiApplication.getUiApplication().pushScreen(dls);
}
}
....
public boolean DeviceListScreen.onClose()
{
// Put data in list.
return true;
}
Whil I'm stepping through the code, the onClose() gets called and everything happens nicely, except the screen doesnt go away. Since I've overwritten the onClose method is there something else I need to do like a popScreen?
|