androidandroid-intentandroid-print-framework

PrintHelper activity result


I am using PrintHelper for printing images from my application. Is there any way to use activity result for PrintHelper or any workaround to know that the user has initiated the print.

I am using the following code for printing :

PrintHelper photoPrinter = new PrintHelper(getApplicationContext());
                    photoPrinter.setScaleMode(PrintHelper.SCALE_MODE_FIT);
                    photoPrinter.printBitmap("printName", bitmap);

Thank you.


Solution

  • Seems like PrintHelper is not that flexible to track cancellation event. You can create custom PrintDocumentAdapter and print document using PrintManager. There you will get method which is called when printing was done and if it was cancelled. For more info take a look at the article: https://github.com/shinobicontrols/bitesize-kitkat/blob/master/PrintShop/PrintShop.md