如何从我目前的应用程序中打开Android中的PrinterShare应用 [英] How to open PrinterShare application in android from my current application

查看:547
本文介绍了如何从我目前的应用程序中打开Android中的PrinterShare应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我开发一个Android应用程序,我碰到启动安装在我的Andr​​oid手机上了PrinterShare应用程序的需要。我想,当用户点击按钮控制在我的应用程序,它应该启动的PrinterShare应用程序。当用户与他/她需要打印的文档做了,那么就应该回来家庭应用,从当它被推出。

任何想法,code段将AP preciated。 谢谢..: - )

解决方案

最近,但幸运的是我得到的答案

。 在这里,它是:

 意向书我=新的意图(Intent.ACTION_VIEW);
i.setPackage(com.dynamixsoftware.printershare);
i.setDataAndType(printFileUri,text / plain的);
startActivity(ⅰ);
 

其中printFileUri如下:

  static final的乌里printFileUri = Uri.parse(文件:///sdcard/Calci_print.txt);
 

如果任何人有另一种建议,其最欢迎..: - )

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.. :-)

解决方案

Lately but fortunately I got the answer. Here it is:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setPackage("com.dynamixsoftware.printershare");
i.setDataAndType(printFileUri,"text/plain");
startActivity(i);

where 'printFileUri' is as follows:

static final Uri printFileUri = Uri.parse("file:///sdcard/Calci_print.txt");

If anyone has still another suggestion, its most welcomed.. :-)

这篇关于如何从我目前的应用程序中打开Android中的PrinterShare应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆