List of usage examples for android.print PrintDocumentAdapter onWrite
public abstract void onWrite(PageRange[] pages, ParcelFileDescriptor destination, CancellationSignal cancellationSignal, WriteResultCallback callback);
From source file:android.webkit.cts.WebViewTest.java
private void savePrintedPage(final PrintDocumentAdapter adapter, final ParcelFileDescriptor descriptor, final FutureTask<Boolean> result) { adapter.onWrite(new PageRange[] { PageRange.ALL_PAGES }, descriptor, new CancellationSignal(), new WriteResultCallback() { @Override/* ww w . j a v a2 s.co m*/ public void onWriteFinished(PageRange[] pages) { try { descriptor.close(); result.run(); } catch (IOException ex) { fail("Failed file operation: " + ex.toString()); } } }); }