02-01-2013 09:15 AM
I successfully implemented a SHARE action, using the following code:
InvokeActionItem* shareItem(InvokeActionItem::create( InvokeQuery::create() .parent(page) .invokeActionId("bb.action.SHARE") .mimeType(mimeType) .uri(fileURI))); page->addAction(shareItem, ActionBarPlacement::OnBar);
This works beautifully. For every file that my app downloads and stores in the file system, a SHARE menu item is displayed, which I can use e.g. for emailing the file to someone else.
Now I wanted to implement the same for the OPEN action in order to be able to open a file in a different app. This doesn't work at all. Here is my code:
InvokeActionItem* openInItem(InvokeActionItem::create( InvokeQuery::create() .parent(page) .invokeActionId("bb.action.OPEN") .mimeType(mimeType) .uri(fileURI))); page->addAction(openInItem, ActionBarPlacement::OnBar);
But I only get this in the log:
Warning: 15:09:54.649 InvocationWrapper::onQueryFinished: no matching result from Menu Service for query mimeType="application/pdf" uri=QUrl("file:///accounts/ ... /myFile.PDF") data= "" metadata= QMap() perimeter= 0 action= "bb.action.OPEN" target= "" invokerIncluded= false
I also tried using "data" instead of "uri" and passing in a QByteArray which contains the bytes of the file. This doesn't work either.
Curiously, if I leave out both "uri" and "data", it works. An Open In menu item is displayed, which lists apps that can open the specified MIME type. But of course this menu only opens the apps, it doesn't pass the file uri or file data.
Is this a limitation of the Dev Alpha devices? Or is there a different way for opening locally stored files in other apps?
Solved! Go to Solution.
02-07-2013 09:37 AM
They are in the data area. But that was not the problem. I now have the confirmation that everything is working as intended on a real Z10 device. So the problem seems to be a limitation of the Dev Alpha OS.