如何使用云打印来打印Android的活动展示 [英] How to print Android activity display using cloud print

查看:331
本文介绍了如何使用云打印来打印Android的活动展示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现谷歌云打印成一个应用程序,继集成指南。我试图保持它的基本只需打印出google.com。当我点击创建打印按钮,将弹出的对话框中,但我正在逐渐出现FileNotFoundException说明

I am trying to implement Google Cloud Print into an app, following the Integration Guide. I'm trying to keep it basic by just printing out google.com. When clicking the print button I created, it brings up the dialog, but I am getting a FileNotFoundException stating

java.io.FileNotFoundException:没有内容提供商:
  
http://www.google.com

java.io.FileNotFoundException: No content provider: http://www.google.com

如果我再选择一台打印机,并单击打印对话框给了我一个文档中缺少信息的基础上,FileNotFoundException异常这是有道理的。

If I then select a printer and click print, the dialog gives me a "Document Missing" message, which makes sense based on the FileNotFoundException.

我把print_dialog.xml和PrintDialogActivity.java逐字从导向。这里是我的code调用活动:

I took print_dialog.xml and PrintDialogActivity.java verbatim from the guide. Here is my code calling the activity:

Intent printIntent = new Intent(getActivity(), PrintDialogActivity.class);
Uri docUri = Uri.parse("http://www.google.com");
printIntent.setDataAndType(docUri, "text/html");
printIntent.putExtra("title", "Google");
startActivity(printIntent);

我试图找出如何打印网页,但最终希望能够打印活动显示。

I'm attempting to figure out how to print a web page, but would eventually like to be able to print the activity display.

所以我的问题是:我需要什么才能打印网页或活动显示做

So my question is: What do I need to do in order to print a webpage or activity display?

推荐答案

尝试以下内容添加到您的应用程序清单

Try to add the following to your application manifest

<uses-permission android:name="android.permission.INTERNET" />

这篇关于如何使用云打印来打印Android的活动展示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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