在Android的打印图像图像、Android

由网友(↑情如劍崶んоμ↓)分享简介:我使用的是下面的code将命令发送到打印机。 temp文件夹中创建的文件发送到该文件夹​​。但它给了我一个错误说`I am using the below code to send the command to the printer. The temp folder is created and the file...

我使用的是下面的code将命令发送到打印机。 temp文件夹中创建的文件发送到该文件夹​​。但它给了我一个错误说`

I am using the below code to send the command to the printer. The temp folder is created and the file is sent to the folder. but it gives me an error saying `

无活动来处理这个意图(ACT = com.dynamixsoftware.printershare.print DAT =文件:///mnt/sdcard/temp/picture1230841297.stream典型值=应用程序/ x-机器人 - 图片流(有临时演员)}

在code是

    public static boolean queuePictureStreamForPrinting( Context context, File f )
    {
        // send to print activity
        Uri uri = Uri.fromFile( f );
        Intent i = new Intent( PRINT_ACTION );
        i.setDataAndType( uri, "application/x-android-picture-stream" );
        i.putExtra( "scaleFitToPage", true );
        context.startActivity( i );

        return true;
    }

这是我缺少的是什么有什么建议?

Any suggestions on what am missing?

推荐答案

您缺少的应用程序,这实际上是能够使用的打印意图您尝试启动。 安装任何可接收 com.dynamixsoftware.printershare.print 意图。如果已经安装,请确保URI和MIME类型是有意义的该应用程序。

You are missing an app, that is actually able to use that print-intent you are trying to start. Install whatever can receive com.dynamixsoftware.printershare.print intents. If this is already installed, make sure the uri and mime-type make sense to that app.

这是意图仅仅是一个信号做一些工作。它会在运行时出动,所以没有编译时检查错误。这也允许在某些情况下,用户(例如,通过电子邮件发送)多个可能的接收者之间进行选择

An intent is only a signal to do some job. It will be dispatched at runtime, so there is no compile time checking for errors. This also allows the user in some cases (e.g. send by email) to choose between multiple possible receivers

阅读全文

相关推荐

最新文章