Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Amit_K
Posts: 135
Registered: 08-27-2008
Accepted Solution

How to remove the global popupscreen ?

[ Edited ]

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(UiApplication.getUiApplication().getActiveScreen( )); 

 

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

Message Edited by Amit_K on 09-19-2008 01:12 AM
Please use plain text.
Developer
peter_strange
Posts: 13,585
Registered: 07-14-2008

Re: How to remove the global popupscreen ?

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(currentpopupscreen);

 

when you want to dismiss currentpopupscreen.

 

 

Please use plain text.
Developer
Amit_K
Posts: 135
Registered: 08-27-2008

Re: How to remove the global popupscreen ?

[ Edited ]

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.

 

 

 

 

 

 

 

 

 

Message Edited by Amit_K on 09-19-2008 04:55 AM
Please use plain text.
Developer
peter_strange
Posts: 13,585
Registered: 07-14-2008

Re: How to remove the global popupscreen ?

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.

Please use plain text.
Developer
Amit_K
Posts: 135
Registered: 08-27-2008

Re: How to remove the global popupscreen ?

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.

 

 

 

Please use plain text.
Developer
Amit_K
Posts: 135
Registered: 08-27-2008

Re: How to remove the global popupscreen ?

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 ?

 

 

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 10,873
Registered: 07-09-2008
My Carrier: Bell

Re: How to remove the global popupscreen ?

No, there is no way to dismiss all global screens.  You'll need a reference to the screen you wish to close.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Developer
callsamik
Posts: 4
Registered: 11-21-2009

Re: How to remove the global popupscreen ?

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.

Please use plain text.