从第三方 Blackberry 应用程序启动 Documents To Go 应用程序
我想知道是否可以使用第三方黑莓应用程序中的“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想打开特定文档,由于 Docs ToGo 注册来处理这些扩展,您可以使用注册表调用,它将为您处理。查看注册表和 调用 类,以下代码将打开给定路径中的文档,Docs ToGo 将通过注册表接管:
如果没有文件内容类型的注册处理程序 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:
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.
您可以使用 ApplicationManager< /a> 类来启动其他应用程序,例如通过查找其描述符并使用 runApplication()。您还可以在描述符中传递参数,如果应用程序查看传递到其中的参数,它实际上可能会打开指定的文件。
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.