从第三方 Blackberry 应用程序启动 Documents To Go 应用程序

发布于 2024-08-26 18:00:20 字数 68 浏览 5 评论 0原文

我想知道是否可以使用第三方黑莓应用程序中的“Documents To Go”应用程序打开 doc、xls、pdf 等文件。

I was wondering if it's possible to open doc, xls, pdf, etc files using the "Documents To Go" app from a third party blackberry app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

听,心雨的声音 2024-09-02 18:00:21

如果您想打开特定文档,由于 Docs ToGo 注册来处理这些扩展,您可以使用注册表调用,它将为您处理。查看注册表调用 类,以下代码将打开给定路径中的文档,Docs ToGo 将通过注册表接管:

Invocation invocation = new Invocation(path);
Ragistry reg =  = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);

如果没有文件内容类型的注册处理程序 ContentHandlerException 将抛出错误代码 ContentHandlerException.NO_REGISTERED_HANDLER

注意:Docs ToGo 中有一个小错误 - 关闭文档或单击后退按钮可能不会引导用户返回到您的应用程序。

编辑: getRegistry 函数采用类完全限定名称,例如 com.softartisans.SilverDust,其中 SilverDust 是类鬃毛。您可以找到有关注册表使用的更多信息 在此在线书籍起始页 291 - 客户端对注册表的使用。我最初链接到 javax 注册表,但查看 BlackBerry 注册表 文档。

If you want to open a specific document, since Docs ToGo registers to handle these extensions, you can use the Registry invocation and it will be handled for you. Take a look at the Registry and Invocation classes, the following code will open the document in the given path, Docs ToGo will take over through the Registry:

Invocation invocation = new Invocation(path);
Ragistry reg =  = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);

If there is no registered handler for the file content type a ContentHandlerException will be thrown with error code ContentHandlerException.NO_REGISTERED_HANDLER.

Note: there's a small bug in Docs ToGo - closing the document or clicking the back button might not lead the user back to your application.

EDIT: The getRegistry function takes a class fully qualified name e.g. com.softartisans.SilverDust, where SilverDust is the class mane. You can find more info about the use of the Registry in this online book starting page 291 - Client use of Registry. I originally linked to the javax Registry, but it is more useful to look at the BlackBerry Registry docs.

ゞ记忆︶ㄣ 2024-09-02 18:00:21

You can use the ApplicationManager class to launch other applications, for example by looking up its descriptor and using runApplication(). You can also pass arguments in the descriptor and if the application looks at arguments passed into it, it may actually open the specified file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文