如何将字节数组传递给asyncTask?

时间:2014-09-17 19:17:44

标签: java android-asynctask android-studio byte

当我使用byte []

时,Android Studio会抛出此错误

错误: 预期参数:byte [] 实际参数:byte [] []

当我传递byte时出现此错误:“type argument不能是原始类型”

class PrintOrderTaskSTARIO extends AsyncTask<byte[], Void, Void> {

     ......

@Override
protected Void doInBackground(byte[]... print) {

    String portName = "";
    String portSettings = "9100";

    StarIOPort port = null;
    System.out.println("2");

    //TRY TO PRINT....
    try
    {
        port = StarIOPort.getPort("tcp:10.1.10.18", "9100", 10000);

        //Start checking the completion of printing
        port.writePort(print, 0, print.length);

0 个答案:

没有答案