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
New Developer
ttabbal
Posts: 5
Registered: ‎07-24-2008
My Device: Not Specified
Accepted Solution

Does Invoke() block?

I was wondering if the Invoke method to call internal apps like the camera or phone app will block until the user is done with the app? I would like to take some action after the user interaction with the internal app is complete. Alternately, could I use the KeyListener or TrackWheelListener to track user interaction? For example, it might be interesting to have the user take a picture, then do something with it, like compose an MMS or EMail. This would be in 4.2 preferably.
Please use plain text.
Developer
acowart
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: Does Invoke() block?

[ Edited ]

For your example, the best solution would be to use a listener.

 

More information can be found in this thread:

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=714

Message Edited by acowart on 07-24-2008 12:19 PM
Andrew Cowart | Metova
www.metova.com
Please use plain text.
New Developer
ttabbal
Posts: 5
Registered: ‎07-24-2008
My Device: Not Specified

Re: Does Invoke() block?

A file system listener is a fine idea to know what files changed, but how do I know when to prompt the user? That's why I was wondering if invoke is a blocking call. If it is, I can just wait till it returns. If not, I need to know when the user is done with the other app.

 

I've noticed that when Viigo calls the browser, when I exit the browser I return to Viigo. Is there a way to tell when that happens? So I could call the camera (or browser, phonebook, whatever) and when the user is done they return to my app. Is there an event I can listen for or a function I can poll to see if it's me in the foreground?  

Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Does Invoke() block?

[ Edited ]

You can call Application.isForeground() to see if your app is in the foreground.

 

Also, if you are wondering if a function is blocking or not, you can do a printout after the call, and then check to see when it shows up. (Yes, invokeApplication is a blocking call).

Message Edited by mreed on 07-24-2008 02:51 PM
Please use plain text.
New Developer
ttabbal
Posts: 5
Registered: ‎07-24-2008
My Device: Not Specified

Re: Does Invoke() block?

Thanks for the info mreed. I thought about trying it myself, but I'm at the office and don't have the JDE installed here (against IT policy).

 

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Does Invoke() block?

If you have a screen displayed, you can also override the Screen.onExposed method.  This method is called when a screen comes into view, which could happen when a user closes the application you invoked.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.