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
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Invoke Built in Menu Items

Hello Everyone,

 

I am making an application in which I wanna run the Menu Item "Answer-Hold Current" of the Call Waiting Screen as soon As Call Waiting is  Detected...

 

I have applied PhoneListener and  a thread to wait until the Call waiting screen is fully displayed... But still the menu does not get Invoked...

 

Here are the used Functions:

 

 

public void runMenuItem(String menuItemText) {
                Screen screen = UiApplication.getUiApplication().getActiveScreen();
                Menu menu = screen.getMenu(0);
                for (int i = 0, cnt = menu.getSize(); i < cnt; i++)
                if (menu.getItem(i).toString().equalsIgnoreCase(menuItemText))
                menu.getItem(i).run();
    }


public  void holdActiveCall() {
        runMenuItem("Answer-Hold Current");
    }

public void joinCalls() {
        runMenuItem("Join Conference");
    }

 

 

 Please Help to figure out why are the Menu items not invoked???

 

Thanks in Advance....

 

 

 

 

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke Built in Menu Items

list the menu labels with a sysout or into the logger, this should show you if the menu items are available.

be aware that you have to (temporary) switch the locale to English if you have another language selected.

----------------------------------------------------------
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: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Invoke Built in Menu Items

Thanks For the reply Simon...

 

I did As u Said and I am getting these options on Waiting screen as  well as on the Calling Screen...

 

Begin
Help
Flash
Enhance Call Audio
Mute
Notes
Activate Speakerphone
View Contacts
View Calendar
View Messages
Show Dialpad
Switch Application
Home Screen

 

While waiting Screen has only 2-3 options (Answer-HoldCurrent, Ignore etc.)

And These both dont have two options I require..

 

1) Answer-Hold Current

2) Join Conference

 

Though  both options can be seen on the screen in the menu.

 

Can you please tell me what to do to achieve this task??

 

Regards

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke Built in Menu Items

the waiting screen is a global screen (you cannot navigate away from it) and thus cannot be accessed from the phone listener. you will not be able to retrieve these menu items.

----------------------------------------------------------
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: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Invoke Built in Menu Items

Thanks For the Reply...

 

Actually, I was trying to Accept the Call as soon as A waiting call comes... which would send the current call to Hold...

Then i was trying to  join these calls at the same time to start a conference call...

 

Another way to Accept the call Is EventInjector as told by you in this thread:

 

http://rim.lithium.com/t5/Java-Development/Is-it-possible-to-programmatically-accept-an-incoming-cal...

 

But how to unhold the current call and start a conference call after that??

 

Is there any other way to do so???

 

PLZ HELP !!! I really need this feature to be implemented....

 

Regards

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke Built in Menu Items

event injection would be the only way. i don't suggest it, it's messy, but you will not be able to achieve it otherwise as there is no API for it and you cannot access the screen.

----------------------------------------------------------
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: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Invoke Built in Menu Items

Thanks  Simon, let me try that way....

 Will post the outcome...

 

Regards,

 

 

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Invoke Built in Menu Items

One more thing I would like to ask... in event injection how do i inject trackball events like UP,DOWN,RIGHT,LEFT and PRESS(Select) ???

 

Regards

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Invoke Built in Menu Items

I got the solution to previous post...

But i wanna confirm one thing...

If a user installs a third party application which adds menu item  to already existing menu of any inbuilt application(calendar, in call menu).. will that entry be always on the top?? or can it be inserted any where in the menu??

 

Regards..

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke Built in Menu Items

applicationmenuitem has an order parameter, i have never used it though so i cannot confirm if it places the item accordingly

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