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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Contributor
drgfl
Posts: 8
Registered: ‎02-15-2011
Accepted Solution

How to push my app to foreground after a phonecall

Hi all,

 

I am developping a rather basic app similar to a phone directory. It is possible to view the details of a contact and place a call to him using a pushbutton.

 

I am placing the call this way :

	public void call(String number) {

		PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL,
				number);
		Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);

	}

 It works fine, but at the end of the call the phone interface remains on the foreground. I can't figure out how I can bring my application on the foreground.

 

My application is supposed to work on various OS, starting from 4.2.

 

Thanks in advance for your help.

 

Please use plain text.
Developer
simon_hain
Posts: 13,829
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: How to push my app to foreground after a phonecall

use a phonelistener
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Contributor
drgfl
Posts: 8
Registered: ‎02-15-2011

Re: How to push my app to foreground after a phonecall

I have tried to use a phone listener :

 

	public void callDisconnected(int callId) {
		UiApplication.getUiApplication().requestForeground();
	}

 

But it has no effect although this method is executed when the calls end. Am I mising something ?

Please use plain text.
Developer
simon_hain
Posts: 13,829
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: How to push my app to foreground after a phonecall

yes, albeit nothing too obvious.

the phonelistener runs in the context of the phone application. if you call UiApplication.getUiApplication() you get a reference to the phone app, not your own.

use a global event to communicate the event to your app.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Contributor
drgfl
Posts: 8
Registered: ‎02-15-2011

Re: How to push my app to foreground after a phonecall

Thanks for your help, it works !

 

For anybody who would have the same issue, I found an example for GlobalEvents here : http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...

Please use plain text.