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

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.

Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Enable Share button in context menu

[ Edited ]

I'm about to start my weekend, but I'll still write this, maybe it helps Smiley Happy


it still sounds to me like you are not adding the ANE correctly (or maybe you have no mailaccount or such? Simulator?). The file may be read in Flash CS, the file may be still compiled with, but something is still wrong


This is a simple class, which has a single static call 'invoke'


import flash.utils.ByteArray;
import qnx.invoke.*;

public class InvokeShare {
    public static function invoke():void {
        var byteData:ByteArray = new ByteArray();
        byteData.writeUTFBytes("Share me!");

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



I know it looks like the classes jdolce wrote, and I know it looks like the example code. Simply - because it is





- create a new empty project with ALL 4 standard ane's

- add a button to the gui, add code in different class

- onClick -> call static function


If it works -> you did import the ane's correctly, the error is somewhere else

If not -> we need more information, most likely your code + app.xml + bar-descriptor (shortened to the necessary information)



also, a question I forgot to ask: what device are you testing on?

I'm a bird from outer space. But I'm not flappy o.o
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: Enable Share button in context menu

That works! Thanks!! Smiley Happy


Noq I only need to get the SHARE button in the context menu to show up. 

I have a textfield where I would like to share the selected text via the SHARE context menu button.


I tried this code but the SHARE button is not showing up:

import qnx.events.InvokeEvent;
import qnx.invoke.*;

import qnx.fuse.ui.core.InvokeActionItem;
import qnx.fuse.ui.core.ActionSet;
import qnx.fuse.ui.core.ActionBase;

import flash.utils.ByteArray;

var ba:ByteArray = new ByteArray();
ba.writeUTFBytes("Some text to share");

var openapp:Button = new Button();
var invokeItem:InvokeActionItem = new InvokeActionItem(null,"text/plain",null,ba);
var actionSet:ActionSet = new ActionSet(new <ActionBase>[invokeItem]);
var actions:Vector.<ActionSet> = new <ActionSet>[actionSet];

openapp.contextActions = actions;


 Any ideas or other examples I could try?

Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Enable Share button in context menu

for the context menu, I answered you in the other thread




If my invoke-code worked, then just rewrite it to



and pass the text of your textfield to that function


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