Changes

A Guide to Android 6 Custom Document Printing

18 bytes removed, 08:08, 28 January 2016
m
Text replacement - "<google>BUY_ANDROID_STUDIO6</google>" to "<htmlet>androidstudio_a6</htmlet>"
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
As the new class currently stands, it contains a constructor method which will be called when a new instance of the class is created. The constructor takes as an argument the context of the calling activity which is then stored so that it can be referenced later in the two callback methods.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
With the outline of the class established, the next step is to begin implementing the two callback methods, beginning with onLayout().
In the event that the page count is zero, the code reports this failure to the Printing framework via a call to the onLayoutFailed() method of the LayoutResultCallback object.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
The call to the onLayoutFinished() method notifies the Printing framework that the layout work is complete, thereby triggering a call to the onWrite() method.
}
</pre>
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Drawing the Content on the Page Canvas ==
Having drawn on the canvas, the method returns control to the onWrite() method.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
With the completion of the drawPage() method, the MyPrintDocumentAdapter class is now finished.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>