04-25-2012 05:33 AM
Hello all i want to control on pushing the screen globally from background application. currently i made a Screen which is extending MainScreen. I want to show this screen globally. I am using
pushGlobalScreen(Screen to push, int priority, flag); its working if there is two screen it showing one after other. But what i want to do actually is. I want to close the first screen then i want to show the next screen and so on . So how to acheive this. Please help me
Solved! Go to Solution.
04-25-2012 05:50 AM
04-25-2012 05:59 AM
04-25-2012 06:03 AM
04-25-2012 06:04 AM - edited 04-25-2012 06:18 AM
its my own ... can i provide some snippet of code....
I am explaining the whole scenario I am checking in the database for the time if current time matches with the alarm time then it pushes the screen let suppose there is more than one alarm is saved for the same time.
while (Cheking into database for time){
if (databasetime == current time ) {// let suppose there is more than one alarm save for the same time
synchronized (getEventLock()) {// This will call one after other but i want to first
UiEngine ui = Ui.getUiEngine();
ui.pushGlobalScreen(new AlarmScreen() , 1, UiEngine.GLOBAL_QUEUE);// Here i want to stop to user to close the screen then i want to push again the screen.
}
}
}
I think my requirement is clear now. is it?? if not i can explain it again.
04-25-2012 06:42 AM
04-25-2012 06:47 AM
04-25-2012 07:11 AM
04-25-2012 07:14 AM - edited 04-25-2012 07:19 AM
pushModalScreen does not apply to Global screens. You need the GLOBAL_MODAL flag.
That said, you really should only be using Global screens to alert the user to problems. They are not intended to be used for application processing and will behave differently to normal screens (for example you will struggle to get menus).
I think in this situation, if you do only want to have one alarm screen on display at a time, you will need to keep a reference to the pushed Alarm screen to save you pushing another one. You will have to use the closing of this screen to check for and display other alarms that have been generated since this was displayed. If no other alarms are due, then the reference can be removed so your background application is free to push a new Global screen.
04-25-2012 07:19 AM - edited 04-25-2012 07:24 AM
@peter_strange okk so is there any way i can achieve this scenario
while(cursor.next()){
if (databasetime == current time ) {// let suppose there is more than one alarm save for the same time
synchronized (getEventLock()) {
UiEngine ui = Ui.getUiEngine();
ui.pushGlobalScreen(new AlarmScreen() , 1, UiEngine.GLOBAL_QUEUE);// Here i want to stop and want user to close the screen then i want to push again the screen.
}
}
}