- Forum posts: 1
Nov 27, 2017, 1:25:25 PM via Website
Nov 27, 2017 1:25:25 PM via Website
Hi Everyone,
I am having problem updating the Copies in the print UI to more than 1 copy, I am using the below code:
PrintManager printManager = (PrintManager) getActivity().getSystemService(Context.PRINT_SERVICE);
PrintAttributes.Builder attbuilder = new PrintAttributes.Builder();
attbuilder.setMediaSize( PrintAttributes.MediaSize.ISO_A4);
PrintJobInfo prtJobInfo = printManager.print(jobName, pda, attbuilder.build()).getInfo();
PrintJobInfo.Builder jobBuilder = new PrintJobInfo.Builder(prtJobInfo);
jobBuilder.setCopies(numberOfCopies);
prtJobInfo = jobBuilder.build();
Intent bkpIntent = getActivity().getIntent().putExtra(PrintService.EXTRA_PRINT_JOB_INFO, prtJobInfo);
Log.d(TAG, “printWifi bkpIntent: “+ bkpIntent.getParcelableExtra(
PrintService.EXTRA_PRINT_JOB_INFO));
getActivity().setIntent(bkpIntent);
getActivity().setResult(Activity.RESULT_OK, getActivity().getIntent());
However, after printJob has been created (by 'printManager.print' function), it doesn't seem to be updating even though the log show the intent has been updated correctly.
Anyone can provide some help / insight in why the intent is not refreshing?
Thank you
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.