02-10-2009 06:33 PM - edited 02-10-2009 06:39 PM
I have an application that displays a PopupScreen that consumes only part of the screen. Currently, I have designed the application as an "Application" vs "UiApplication" so I don't see the ugly white screen of death. I have been pushing my screen as a Global screen fine.
The problem is that now I want to use the Invoke API to open a new message pre-populated with a destination. When I call:
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(tm));
where "tm" implements javax.wireless.messaging.TextMessage.
The problem is that I get a ClassCastException because the Invoke API is trying to call getUiApplication.
Thread [project(125)id=1035919360] (Suspended (exception ClassCastException))
UiApplication.getUiApplication() line: 474
SMSEditorScreen(ModelScreen).go(boolean) line: 460
SMSEditorScreen(ModelScreen).go() line: 454
SMSEditorScreen.run() line: 739
SMSEditorScreen.runEditor(Object, SMSModel) line: 563
SMSComposeVerb.runEditor(ContextObject, SMSModel) line: 213
SMSComposeVerb.doInvoke(Object) line: 174
SMSComposeVerb(ShowMessageAppVerb).invoke(Object) line: 76
Invoke.invokeVerb(Verb, Object) line: 733
Invoke.invokeApplication(int, ApplicationArguments) line: 413
Is there a way I can make my application a UiApplication that only consumes part of the screen without a white background or workaround the problem some other way?
Solved! Go to Solution.
02-13-2009 10:32 AM
You can accomplish this by extending UiApplication. When your application starts, have it call Application.requestBackground to move it to the background before you push your popup screen. This avoids the white screen background. You can also override Application.acceptsForeground to return false, preventing your application from showing up in the task switcher.
This should also allow you to use the invoke class.