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 Contributor
swest
Posts: 2
Registered: ‎11-12-2012
My Device: BlackBerry® Bold 9700
Accepted Solution

Application is not automatically brought into foreground on second launch

Hey,

I have a problem that is probably easiest explained by using the ActiveTextFieldsDemo sample that is provided with the SDK. 

 

Basically, if I go into my calendar application, type a 9 digit number into an Active Text Field, click on it, then click Location, the instance of FmcUiApplication is loaded, no problems so far.

 

Now, if I then choose to click on the "End Call" button, which sends the program into the background, and then want to  invoke the application again from an active text field, I can't - the logs report that the application is already running, if I go to "switch application" from the BB menu, I can see it is running, but it is not brought into the forground automatically from the active text field invocation.

 

I have tried the following:

1. Putting the following inside of the Run() method of the ApplicationMenuItem instance. 

 

ApplicationManager.getApplicationManager().requestForeground(ApplicationManager.getApplicationManager().getProcessId(ApplicationDescriptor.currentApplicationDescriptor()));

Which had no effect on bringing the application into the foreground

 

2. Attempting to close the application when it is sent into the background, by overriding the deactivate() method and calling requestClose(). This failed to close the application and therefore did not work round the issue. 

 

Any help would be much appreciated!

 

Sam

Please use plain text.
New Contributor
swest
Posts: 2
Registered: ‎11-12-2012
My Device: BlackBerry® Bold 9700

Re: Application is not automatically brought into foreground on second launch

Scratch that, solution 1 worked, my simulator wasn't updating properly :smileyfrustrated:

Please use plain text.