我需要帮助,请在Android上更新我的printJob。
我正在修改printJobInfo,特别是setCopies参数,但布局仍然将副本数读为1:
PrintManager printManager = (PrintManager) currentActivity.getSystemService(Context.PRINT_SERVICE);
PrintAttributes.Builder attbuilder = new PrintAttributes.Builder();
attbuilder.setMediaSize( PrintAttributes.MediaSize.ISO_A4);
PrintJob newPrintJob = printManager.print(jobName, pda, null);
PrintJobInfo newPrintJobInfo = newPrintJob.getInfo();
PrintJobInfo.Builder jobBuilder = new PrintJobInfo.Builder(newPrintJobInfo);
jobBuilder.setCopies(numberOfCopies);
jobBuilder.setPages(new PageRange[] {PageRange.ALL_PAGES});
jobBuilder.setAttributes(attbuilder.build());
getActivity().getIntent().putExtra(PrintService.EXTRA_PRINT_JOB_INFO, newPrintJobInfo);
getActivity().setIntent(getActivity().getIntent());
getActivity().setResult(Activity.RESULT_OK, result);
但是,这并没有更新我的printJob,它将属性保持为null,副本数量为1,如下所示。
有任何想法吗???