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
Highlighted
New Developer
Posts: 27
Registered: ‎01-11-2009
My Device: Not Specified

[initiate Call and get Dialog keyDown event]

Dear all,

    I have two Questions:

1- How to initiate phone call.

2- Iam using Dialog.ask and Dialog.inform....if the user press the send key or end key will go out of my application i want to override the keydown function of the default dialog class and handle the keydown action , How to do that ?

 

Thanks

Wael Nabil

Developer
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: [initiate Call and get Dialog keyDown event]

Hi,

 

1. 

PhoneArguments pA = new PhoneArguments(ARG_CALL, numberToCall);

Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pA));

2.

ask returns an int value of the selected choice!

 

Regards,

Jochen

New Developer
Posts: 27
Registered: ‎01-11-2009
My Device: Not Specified

Re: [initiate Call and get Dialog keyDown event]

Dear ,

     Thanks for your answer..

About the secound Question seem i didn't success to explain it.

My Question Not about how to get the selected button from this dialog "Yes or No"  or like that

My Question about while this dialog is focused the user may click on the Green Send Key which show the Call list and i want to prevent that So is there any way to get the KeyDown event while this Dialog is shown 

Thanks

Wael Nabil

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

Re: [initiate Call and get Dialog keyDown event]

protected boolean keyDown(int keycode,
int time)
Just override this method. When you will press, green key, this method will return you the keycode of pressed key. just consume the event on specified key and you will be able to prevent any action on presssing green key.
New Developer
Posts: 27
Registered: ‎01-11-2009
My Device: Not Specified

Re: [initiate Call and get Dialog keyDown event]

Thanks for the answer

But this will apply only on your screen example you make a class extends MainScreen

but if i show Dialog by Dialog.inform or Dialog.ask this is as another screen over my main screen so it has another keyDown.

my Question is how to override this Dialog keyDown.

 

Thanks

Wael Nabil

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

Re: [initiate Call and get Dialog keyDown event]

have you tried withoverridinbg keyChar() there ?