Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
pfluger
Posts: 100
Registered: ‎02-10-2009
My Device: Q10, Z10
Accepted Solution

Cannot invoke messaging app with new message from pushGlobalScreen

I have an application that registers itself as an OptionsProvider and listens for incoming e-mails. Within the folderEvent I push a global popup screen using

UiEngine ui = Ui.getUiEngine(); ui.pushGlobalScreen( popupScreen, 999, 0 );

 

I have a button on this screen that should open a new message in the messaging app. (actually a reply to the received message, but I also tried with a new message). Unfortunately, when I do the following call from within in the button's fieldChanged event

Invoke.invokeApplication( APP_TYPE_MESSAGES, new MessageArguments( newMessage ) )

 

nothing happens. No messages in the log.

Doing this call from within the OptionsProvider's menu works perfectly.

Even more strange is that the following call to open the Inbox works from the popup screen.

Invoke.invokeApplication( APP_TYPE_MESSAGES, MessageArguments( MessageArguments.ARG_DEFAULT ) );

 

I tried changing my application to a UiApplication and wrapping the invokeApplication in an invokeLater to no avail.

Any suggestions?
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Cannot invoke messaging app with new message from pushGlobalScreen

It may be that the global-modal screen is actually blocking the display of the message reply screen.

 

Does the messages app pop up after you close your dialog?

 

 

 

Please use plain text.
Developer
pfluger
Posts: 100
Registered: ‎02-10-2009
My Device: Q10, Z10

Re: Cannot invoke messaging app with new message from pushGlobalScreen

No, even after closing the global screen nothing happens. I already tried closing the screen right before doing the invoke.

 

The strange thing is that the general invoke with no message to open the inbox works. The inbox gets shown right away. I still have to close my global screen but it works.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Cannot invoke messaging app with new message from pushGlobalScreen

One other suggestion: I have found that certain apps, on certain OS levels, won't come to foreground unless the invoking app has the foreground.

 

Try call foreground() before the invoke.

 

 

Please use plain text.
Developer
pfluger
Posts: 100
Registered: ‎02-10-2009
My Device: Q10, Z10

Re: Cannot invoke messaging app with new message from pushGlobalScreen

Calling requestForeground() solved it. Thanks!
Please use plain text.
Developer
justindutoit
Posts: 405
Registered: ‎05-31-2009
My Device: Not Specified

Re: Cannot invoke messaging app with new message from pushGlobalScreen

Hey. Is there any known workaround for this? I'm invoking the Text message compose app, and trying to close or requestbackground for my app immediately. The Text message app closes or 'minimizes' with it.

 

        MessageArguments ma = new MessageArguments(text); //// TextMessage arg assumes arg-new-sms and works

        if (!IsCloseItself())
            globalBrady.requestBackground();

        Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, ma);

        if (IsCloseItself())
            System.exit(1);

 

Makes no difference if I put the requestBackground before or after the invoke line. I suppose I can't requestforeground for the Text message app?

 

Tks

J.

Please use plain text.
Developer
anditsung
Posts: 246
Registered: ‎09-30-2010
My Device: Z10, Onyx2

Re: Cannot invoke messaging app with new message from pushGlobalScreen

UiApplication.getUiApplication().requestForeground();
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments( MessageArguments.ARG_NEW));

 got the same problem..

but i aldready add requestForeground();

 

still doesnt fix the problem

any suggestion?

Please use plain text.