I am using the PrintManager to print a webpage, how can my activity get a callback once printing was successfull? I am using this code:
// Get a PrintManager instance
PrintManager printManager = (PrintManager) this.getSystemService(Context.PRINT_SERVICE);
// Get a print adapter instance
PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter();
// Create a print job with name and adapter instance
String jobName = getString(R.string.app_name) + " Document";
PrintJob printJob = printManager.print(jobName, printAdapter,
new PrintAttributes.Builder().build());
// Save the job object for later status checking
//mPrintJobs.add(printJob);
Create a wrapper around the
PrintDocumentAdapter
received from the webView. Then you can put a hook in the onFinish().And here is how to use it in your code :