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

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

How to add custom menu item to System context menu in apps like Pictures?

I want to add my own custom context menu item to the Pictures app.  When the user holds down  the picture thumbnail I want my own menu item "Open With myApp" to appear along with the system menu items.

 

I looked at the invokeclient sample but it does not show how to add the custom menu item.

 

Is there example app somewhere?  thanks

Developer
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: How to add custom menu item to System context menu in apps like Pictures?

Are you trying to add this to the device's built in camera app? If that's the case, you can't modify the context menu of other applications. Also, invoking only works within your app and calls functionalities from other apps. It does not affect the state or performance of other apps.

 

However, if you're doing this within your own app, check out Adding menus, you'll find code on how to add a context menu or extra items to the context menu using ContextActions:

 

contextActions: [
                ActionSet {
                    title: "Action Set"
                    subtitle: "This is an action set."
                      
                    actions: [
                        ActionItem {
                            title: "Action 1"
                        },
                        ActionItem {
                            title: "Action 2"
                        },
                        ActionItem {
                            title: "Action 3"
                        }
                    ]
                } // end of ActionSet   
            ] // end of contextActions list

 

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to add custom menu item to System context menu in apps like Pictures?


DrShavargo wrote:

Are you trying to add this to the device's built in camera app? If that's the case, you can't modify the context menu of other applications. Also, invoking only works within your app and calls functionalities from other apps. It does not affect the state or performance of other apps.

 

However, if you're doing this within your own app, check out Adding menus, you'll find code on how to add a context menu or extra items to the context menu using ContextActions:

 

contextActions: [
                ActionSet {
                    title: "Action Set"
                    subtitle: "This is an action set."
                      
                    actions: [
                        ActionItem {
                            title: "Action 1"
                        },
                        ActionItem {
                            title: "Action 2"
                        },
                        ActionItem {
                            title: "Action 3"
                        }
                    ]
                } // end of ActionSet   
            ] // end of contextActions list

 


I can adde context menu to my app no problem.  What i want is to add a menu item to the Pictures app so that the user can invoke.  It is similar to Share when you share a picture or text i want my app to show up there so that my app can be invoked.

 

Developer
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: How to add custom menu item to System context menu in apps like Pictures?

I think I understand what you want to do, but I don't know if it possible. All I found was this page on invoking the Pictures app, which allows you to open images with the pictures app, but not much more.

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How to add custom menu item to System context menu in apps like Pictures?

There has to be a way to add entries to outside menus. For example sometimes when I long press phone numbers in the Hub an option is available to open in Beweather.
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to add custom menu item to System context menu in apps like Pictures?


madkristoff wrote:
There has to be a way to add entries to outside menus. For example sometimes when I long press phone numbers in the Hub an option is available to open in Beweather.

Yes. Exactly.  I have seen apps that when doing a long press in the Pictures app it has Open appname.

 

Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to add custom menu item to System context menu in apps like Pictures?

Using the InvokeTarget sample app i was able to get  plain text working with the following in the bar file.

 

            <mime-type>text/plain</mime-type>

if i change it to

 

            <mime-type>image/png</mime-type>

it will not work.

 

Also anyone got the sample working for sharing images?  When i try to share a image the InvokeTarget sample app name is not listed in the share screen.

 

Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to add custom menu item to System context menu in apps like Pictures?

Anybody?

Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How to add custom menu item to System context menu in apps like Pictures?

I feel like the apps that do do it have some kind of special access from BlackBerry. That's the only explanation because I haven't seen how to do this in the documentation and neither have you. Plus no one seems to know.
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Developer
Posts: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to add custom menu item to System context menu in apps like Pictures?


madkristoff wrote:
I feel like the apps that do do it have some kind of special access from BlackBerry. That's the only explanation because I haven't seen how to do this in the documentation and neither have you. Plus no one seems to know.

Like in my previous post.  The sample app does it with text but on images eg; jpg or png.

 

I seen apps that can do this.