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

Adobe AIR Development

Reply
Trusted Contributor
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

How to enable SHARE in BB10 menu?

Hi,

 

I would like to allow users to share text they selected in a textfield (I'm using the "native" StageText) to other apps such as BBM or EMAIL.

How to enable the SHARE entry in the menu list? Currently there are only options for COPY, PASTE in the list...

 

Any example is really appreciated! :smileyhappy:

Thanks

Trusted Contributor
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: How to enable SHARE in BB10 menu?

Is there no sample available?

This is the SHARE button in the menu: 

http://developer.blackberry.com/devzone/files/design/bb10/images/action_overflow_menu_2.png

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to enable SHARE in BB10 menu?

You have to add that Share item as an action to your action bar.
Trusted Contributor
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: How to enable SHARE in BB10 menu?

Can you please explain it a little further? :smileyhappy:
Do I need to add some code to the descriptor.xml file?
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to enable SHARE in BB10 menu?

Maybe I responded to the wrong thread. I thought this was just to add the share item to the action bar. I only use the native text input field, so I am uncertain what to do without some testing for stage text. You might need to just add a normal action to the action bar and share the last selected text.
Trusted Contributor
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: How to enable SHARE in BB10 menu?

I don't know how to do this.

Is there any kind of example code available?

 

Developer
Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane

Re: How to enable SHARE in BB10 menu?

yes. this example would be a share via BBM

 

        var byteData:ByteArray = new ByteArray();
        byteData.writeUTFBytes("This is some text to share.");

        var request:InvokeRequest = new InvokeRequest();
        request.mimeType = "text/plain";
        request.target = "sys.bbm.sharehandler";
        request.action = InvokeAction.SHARE;
        request.data = byteData;

        InvokeManager.invokeManager.invoke(request);

 

 

 

you may have to search the forum a bit, if your classes are not found

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o