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
Posts: 8
Registered: ‎02-15-2011
My Device: Bold 9000
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.

 

Developer
Posts: 16,851
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
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
Highlighted
New Contributor
Posts: 8
Registered: ‎02-15-2011
My Device: Bold 9000

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 ?

Developer
Posts: 16,851
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
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
New Contributor
Posts: 8
Registered: ‎02-15-2011
My Device: Bold 9000

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...

Developer
Posts: 419
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

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

actually when i hit esc key or close button,my screen doesnt close

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

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

use PopUp Screen