09-19-2008 01:10 AM - last edited on 09-19-2008 01:12 AM
Hello everybody,
I am creating the application such that when the application starts then at the begining I am putting that application
in background and then I am pushing the global popupscreen using
UiApplication.getUiApplication().pushGlobalScreen( currentpopupScreen , 1, UiApplication.GLOBAL_MODAL );
afterwords when I want to remove this global popupscreen from other class, I have used the following line of code
UiApplication.getUiApplication().popScreen(UiAppli
but this gives the exception because UiApplication.getUiApplication().getActiveScreen( ) returns null.
then How to remove such global popupscreen ? because in other class getActiveScreen( ) method returns null.
Thanks in advance
Solved! Go to Solution.
09-19-2008 04:33 AM
I believe the problem here is that currentpopupscreen Screen is not part of your Applications Screen stack (it is not part of any Applications screens in fact) becuase you have made it independent but pushing a Global Screen.
So you can't use getActiveScreen() to find it, it is not the top of the Screen stack for your application.
So to dismiss it, you are going to have to retain a reference to it and then do
UiApplication.getUiApplication().popScreen(current
when you want to dismiss currentpopupscreen.
09-19-2008 04:48 AM - last edited on 09-19-2008 04:55 AM
First of all Thank you very much for your reply.
To dismiss the global Popupscreen, we have to retain a reference to it....agreed.
then can I make one DisplayManager class in which I am creating the currentScreen stack.
when each time I am pushing the global popupscreen then at the same time I am keeping that screen ( for Reference ) on the currentScreen stack and for Popping up the screen I am popping up the screen from currentScreen stack.
Does this approach is fine ?
In My application all screens are global Popup screen so if I want to move from One screen to next screen then from next screen to another screen at that time I want to dismiss the currently displayed Popup screen.
Also Global screens also have any screen stack such as Applications Screen stack ?
Thanks in advance.
09-19-2008 05:23 AM
What you are suggesting sounds like it would work.
Remember that Global Screens have a priority that determines their order on the display, rather than the standard Application 'stack' mechanism. I'm not sure if you push two (or more) screens with the same priority, which screen will be displayed on top. I can arguments for both of the obvious options, i.e. oldest on top, and newest on top. So if you are using the same priority, then you might need to test this.
I've two concerns about this approach, a minor application one and a major BB related one.
From the Application perspective, applications and users are used to the 'stacking' of screens, and so, for example, expect updates from one screen to be reflected in the preceding screen. The mechanism you are suggested will not easily facilitate this interaction.
Most importantly, I don't think that Global Screens were intended to be used in the way you are describing. I think they were primarily designed to be used to alert the user to problems in processing and to collect information in a one-off situation. In addition, I think this will give a bad User experience of your application. With a Global screen on the display, the User will not be able to see any of their other applications, like email.
I would strongly encourage you to try to find another method of processing screens in your application.
But I've no idea what your application does and why you feel you need to use Global Screens. I don't need to know. It is your decision. I'm just letting you know what I think.
09-19-2008 10:03 AM
if I push two (or more) screens with the same priority, newest pushed global screen will be displayed on top. I have tested this.
Thanks a lot for your suggestion.
02-05-2009 04:00 AM
To dismiss the global Popupscreen, we have to retain a reference to it....
but if I don't have reference for the global Popupscreen then Can I remove all the global Popupscreen
that are currently displaying on the blackberry device with some method ?
02-09-2009 02:53 PM
11-21-2009 02:45 AM
I've pushed a screen using pushGlobalScreen() method...now I want to pop the screen....I've used popScreen() method to pop but it's showing exception....how to pop a screen pushed using pushGlobalScreen() method...I've the reference of the screen but sitll it's can't be popped using the popScreen() method.