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
Developer
prajith
Posts: 32
Registered: ‎05-24-2009
My Device: Not Specified
Accepted Solution

Can Over ride Call Button using api ? Issue : Shows Context Menu on Track ball click ?

[ Edited ]

 

Hi,

 

1. Anyone have idea about handling call button event. ?

 

By default the call button invoke(shows) the call log window while we pressing the call button (Icon with phone) in the phone.

But i need to invoke some methods in my  application (ie as a select button).  

 

 

2. By default the track ball click  invoke Contaxt menu. I dont want to activate(Show) menu by click on the track ball ? 

 

(Only for the track ball click) 

 

Problem : In my application while clicking  on the track ball over a ButtonField The main window switched to a new Main window.

 

On press escape (pop the new window), the menu displayed there  

 

 

Message Edited by prajith on 06-08-2009 05:47 AM
Please use plain text.
Developer
amardeepjaiman
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Can Over ride Call Button using api ? Issue : Shows Context Menu on Track ball click ?

To your first question  :

 

Make a background application which has the following method implemented :

 

protected boolean keyDown(int keycode, int time)
        {
        switch(keycode)
        {
           
            case 1114112: // green key

 

//Put your code here

           break;
           
        }
        return false;
        }

 

To your Second Question : 

 

implent invokeAction() method , you problem will get solved. 

Please use plain text.
Developer
prajith
Posts: 32
Registered: ‎05-24-2009
My Device: Not Specified

Re: Can Over ride Call Button using api ? Issue : Shows Context Menu on Track ball click ?

[ Edited ]

Hi,

 

Thank you for your respose. (Problem fixed with your solution).

 

 

 

I need to invoked only inside my application 

So i modified the above code as follows (I think it may helpful to others so i included)  

 

MainScreen = new MainScreen();

.....................

mainScreen.addKeyListener(new KeyListener() {

..................................

public boolean keyDown(int keycode, int time) {

if(keycode == 1114112){

// code to be invoked

}

return false;

} ...................//Other methods

 

}

 


 

Message Edited by prajith on 06-08-2009 07:54 AM
Please use plain text.
Developer
prajith
Posts: 32
Registered: ‎05-24-2009
My Device: Not Specified

Re: Can Over ride Call Button using api ? Issue : Shows Context Menu on Track ball click ?

Solution for the second issue

 

he above problem due to the button field event handling 

Wecan avoid the problem with the foloing code whilecreating the button

 

 

ButtonField cancelButton = new ButtonField("Cancel",ButtonField.CONSUME_CLICK);

 


 

 

 

 

ButtonField.CONSUME_CLICK 

Please use plain text.