I have a popup screen (a small screen) stays on开发者_开发知识库 top of a main screen.
This popup screen has a button, the button will close the screen when clicked.
Do you know how to close this popup screen when users tapping on the phone, outside the area that the popup screen cover (without clicking the button)?FYI: app is designed to run on touch phone only (BB Storm, BB Torch...)
You can try overriding the touchEvent method on both the screen and the popup. If you return true in the popups touchEvent then the only touchEvents the screen will receive should be outside of the popup.
http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/Field.html#touchEvent(net.rim.device.api.ui.TouchEvent)
It's not entirely clear what you're after from your question, but generally you can use this code to remove any screen from the screen stack:
UiApplication.getUiApplication().popScreen(screen);
精彩评论