如何从我当前的应用程序在 Android 中打开 PrinterShare 应用程序
当我开发 Android 应用程序时,我发现需要启动安装在 Android 手机上的 PrinterShare 应用程序。我希望当用户点击我的应用程序中的 Button
控件时,它应该启动 PrinterShare 应用程序。当用户完成他/她需要打印的文档时,它应该从启动时返回主应用程序。
任何想法,代码片段将不胜感激。 谢谢.. :-)
As I am developing an android app, I came across the need of launching the PrinterShare app installed on my android phone. I want that when user hits the Button
control in my app, it should launch the PrinterShare app. When user is done with the document which he/she needs to print, then it should come back to home application, from when it was launched.
Any idea, code snippet would be appreciated.
Thanks.. :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最近但幸运的是我得到了答案。
在这里:
其中“printFileUri”如下:
如果有人还有其他建议,最受欢迎..:-)
Lately but fortunately I got the answer.
Here it is:
where 'printFileUri' is as follows:
If anyone has still another suggestion, its most welcomed.. :-)
如果收到 ActivityNotFoundException,请查看已安装软件包的实际名称(来自 Android 控制台的 pm 命令)。就我而言,我发现从 Amazon App Store 购买的副本的包名称为
com.dynamixsoftware.printershare.amazon
。考虑到我的用户可能会从 Google 获取 PrinterShare 应用程序,我实际上会检查包管理器中是否存在以 开头 的第一个包名称 com.dynamixsoftware.printershare。
If you receive an ActivityNotFoundException, take a look at the actual name of the installed package (pm command from Android console). In my case I found that the copy I bought from the Amazon App Store had a package name of
com.dynamixsoftware.printershare.amazon
.Given that my users might obtain the PrinterShare app from Google, I actually check the package manager for the first package name beginning with com.dynamixsoftware.printershare.