打印Google云打印应用程序的意图

时间:2021-07-11 18:52:07

As of today, the official Cloud Print documentation from Google still tells you to include the PrintDialogActivity into your app to print documents using Google Cloud Print. However, it's now also possible to print using the official Google Cloud Print app. I couldn't find any documentation for that though.

截至今天,Google官方的Cloud Print文档仍然告诉您将PrintDialogActivity包含在您的应用中,以便使用Google Cloud Print打印文档。但是,现在也可以使用官方Google云打印应用进行打印。我找不到任何相关的文档。

1 个解决方案

#1


2  

The answer is pretty straightforward, but it still took me a few days to figure it out:

答案非常简单,但我花了几天时间才弄清楚:

Intent printIntent = new Intent(Intent.ACTION_SEND);
printIntent.setType("text/html");
printIntent.putExtra(Intent.EXTRA_TITLE, "some cool title for your document");
printIntent.putExtra(Intent.EXTRA_STREAM, uri);

startActivity(printIntent);

That's the correct way to do it. Important: Intent.ACTION_SEND_MULTIPLE does NOT work at the moment.

这是正确的方法。重要提示:Intent.ACTION_SEND_MULTIPLE目前无效。

#1


2  

The answer is pretty straightforward, but it still took me a few days to figure it out:

答案非常简单,但我花了几天时间才弄清楚:

Intent printIntent = new Intent(Intent.ACTION_SEND);
printIntent.setType("text/html");
printIntent.putExtra(Intent.EXTRA_TITLE, "some cool title for your document");
printIntent.putExtra(Intent.EXTRA_STREAM, uri);

startActivity(printIntent);

That's the correct way to do it. Important: Intent.ACTION_SEND_MULTIPLE does NOT work at the moment.

这是正确的方法。重要提示:Intent.ACTION_SEND_MULTIPLE目前无效。