调用HP ePrint的Andr​​oid应用 [英] Invoking HP ePrint Android application

查看:134
本文介绍了调用HP ePrint的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Android应用程序,应该调用Android的HP ePrint的应用程序进行无线打印。为此,我使用code:

I am working on an android app that should invoke android HP ePrint application for wireless printing. For that purpose, I'm using code:

Intent intent = new Intent("com.hp.android.print.PRINT");
intent.setPackage("com.hp.android.print");

startActivityForResult(intent, 0);

我是pretty的肯定我没有意图的行动吧...有谁知道什么是正确的行动来调用这个HP ePrint的应用程序?我怎样才能通过确切的文件打印(intent.putExtra(...))。

I am pretty sure that I didn't get intent's action right... Does anybody know what is the right action to invoke this HP ePrint application? And how can I pass the exact file to print (intent.putExtra(...)).

感谢

推荐答案

10多个小时后,我设法找到解决方案。右code调用HP ePrint的应用程序是这样的:

After more than 10 hours, I managed to find the solution. Right code to invoke HP ePrint application is like this:



    Uri uri = Uri.fromFile( f );
    Intent intent = new Intent ("org.androidprinting.intent.action.PRINT");
    intent.setDataAndType( uri, "text/plain" );
    context.startActivityForResult(intent, 0);

这篇关于调用HP ePrint的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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