Example usage for android.print PrintJob isCancelled

List of usage examples for android.print PrintJob isCancelled

Introduction

In this page you can find the example usage for android.print PrintJob isCancelled.

Prototype

public boolean isCancelled() 

Source Link

Document

Gets whether this print job is cancelled.

Usage

From source file:de.appplant.cordova.plugin.printer.Printer.java

/**
 * Invokes the callback once the print job is complete or was canceled.
 *
 * @param job/*from  w w  w .j  av  a 2s  . c o  m*/
 *      The reference to the print job
 */
private void invokeCallbackOnceCompletedOrCanceled(final PrintJob job) {
    cordova.getThreadPool().execute(new Runnable() {
        @Override
        public void run() {
            for (;;) {
                if (job.isCancelled() || job.isCompleted() || job.isFailed()) {
                    command.success();
                    break;
                }
            }
        }
    });
}