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
Posts: 57
Registered: ‎06-02-2009
My Device: Not Specified

Displaying custom screen when call is connected .

Can we display our custom screen when call is connected . Is it possible ? I tried with passing custom screen object inside call connected method but my screen gets stuck when call is disconnected .
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Displaying custom screen when call is connected .

You can implement PhoneListener interface and push your own screen but it won't override the standard screen.

 

There is no way to override the standard "call-connected" screen.

Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Displaying custom screen when call is connected .

There are some Notification Apis which gives you the notification of call coming event using startNotification() and stopNotification() methods.

 

But still you can not override the standard "Phone call"  dialogue.

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Displaying custom screen when call is connected .

tbilisoft is not correct here.

it is not possible to push a screen on top of the incoming call screen. there are numerous threads about this topic, even one where it is claimed that it was done sucessfully.
the reason is that it is a global screen with the highest priority. using this priority yourself works on the simulator but throws a security exception on the real device.

it is possible to push a screen on top of the call connected screen, because this is a normal screen displayed within the phone app.
you can do this by using requestForeground in your app. it is a bit tricky to stay in the foreground sometimes but i have played a bit dirty and done it successfully.
----------------------------------------------------------
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
Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Displaying custom screen when call is connected .

Hi simon,

 

May be i m wrong. but still as far as i think you can not do it. But if somehow you have done it and it is working on device, can you show me the code ?

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Displaying custom screen when call is connected .

in callconnected, start a timertask or a thread with some sleep. let your app request foreground, then. take care to call it on your app, not on the phone application.
----------------------------------------------------------
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
Developer
Posts: 29
Registered: ‎03-16-2009
My Device: 8300

Re: Displaying custom screen when call is connected .

[ Edited ]

Hi, try with this code:

 

 

public void callConnected(int callId) {

UiApplication.getUiApplication().pushGlobalScreen(new IncomingCallScreen(), 0, UiEngine.GLOBAL_MODAL);
}

 

 This is a code for extended MainScreen:

 

 

public class IncomingCallScreen extends MainScreen {

public IncomingCallScreen() {
super();
LabelField title = new LabelField("Custom incoming call screen", LabelField.ELLIPSIS |
setTitle(title);
}

protected void onObscured() {
Screen activeScreen = IncomingCallApp.getUiApplication().getActiveScreen();
activeScreen.getUiEngine().suspendPainting(true);
IncomingCallApp.getApplication().requestForeground();
}

protected void onExposed() {
IncomingCallApp.getUiApplication().popScreen(this);
}
}

 

 

 

 

Message Edited by nikolay_taskov on 06-04-2009 09:28 AM
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Displaying custom screen when call is connected .

[ Edited ]
@nikolay_taskov, What is the device and OS version the above code runs.
Message Edited by BBDeveloper on 05-06-2009 11:02 AM

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Displaying custom screen when call is connected .

Hi Nikolao,

 

Your code is working fine Thanks for the information dude.

New Developer
Posts: 57
Registered: ‎06-02-2009
My Device: Not Specified

Re: Re: Displaying custom screen when call is connected .

Hi , i am getting this error when i use this code . cannot find symbol symbol : variable GLOBAL_MODAL location: interface net.rim.device.api.ui.UiEngine UiApplication.getUiApplication().pushGlobalScreen(new Usample5Screen(), 0,UiEngine.GLOBAL_MODAL);