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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha
Accepted Solution

Open Menu of Phone application

[ Edited ]

Hi bb ppl,

 

I have initiated a call programmatically, What I have done is :

 

   private void initiateCall()
        {
              PhoneArguments pa = new PhoneArguments(PhoneArguments.ARG_CALL, "9001100555");
              Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pa);
              EventInjector.KeyCodeEvent pressMENUKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN,  Characters.CONTROL_MENU,
                                                                                       KeypadListener.STATUS_NOT_FROM_KEYPAD, 100);
             EventInjector.KeyCodeEvent releaseEndKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP,Characters.CONTROL_MENU,
                                                                                       KeypadListener.STATUS_NOT_FROM_KEYPAD, 100);
        }

 

And now I want to open the Menu of phone application in current call.  The above code successfully allowed me to make a call, but it doesn't open its menu.. How can I do this? Any tips and guidance reagrding this are warmly appreciable..

 

Thanks & Best Regrds,

Kanak Sony

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 74
Registered: ‎01-03-2010
My Device: Not Specified

Re: Open Menu of Phone application

Hi kanak, try to inject a trackwheelevent next !

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Open Menu of Phone application

Hi jack,

 

I forget to write it... but I have already done that...But its not working:smileysad:

 

       EventInjector.invokeEvent(pressMENUKey);
       EventInjector.invokeEvent(releaseEndKey);

 

Best Regards,

Kanak Sony

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 74
Registered: ‎01-03-2010
My Device: Not Specified

Re: Open Menu of Phone application

hmm just forgot to tell.....:smileytongue:

 

while your call is ongoing everything handled by the all mighty  blackberry phonelistener

so extend it and try injection there in appropriate method

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

Re: Open Menu of Phone application

use a phonelistener. call getActiveScreen and getMenu to retrieve the menu, you can execute the menu item by calling run(). no need for event injection.
----------------------------------------------------------
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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Open Menu of Phone application

Thanks simon for your response... I am trying it and will tell you when over..

Thanks to you too jack for ur interest...

 

Best Regards,

Kanak Sony

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Open Menu of Phone application

Hi Simon,

 

I am implementing phonelistener...Its not a UiApplcation.. So, how can I call getActiveScreen?

 

Thanks,

Kanak Sony

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Open Menu of Phone application

UiApplication.getUiapplication().getActiveScreen()
----------------------------------------------------------
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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Open Menu of Phone application

Hi Simon,

 

I apologise If I am asking a silly question but, I am not getting how to override run() of menuItem..I m doing this

 

            net.rim.device.api.ui.Screen _scr = UiApplication.getUiApplication().getActiveScreen();
            net.rim.device.api.ui.component.Menu _menu = _scr.getMenu(0);
            net.rim.device.api.ui.MenuItem _menuItem = _menu.getItem( 2 );        

 

            //now from here I am not getting what to do, its giving me an error(missing ";")

           _menuItem.run()
            {
                System.out.println("Inside RUN Menu of MenuItem" );
            }

 

Thanks & Regards,
Kanak Sony

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Open Menu of Phone application

why override it? you want to execute it, just call _menuItem.run()
----------------------------------------------------------
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