Stay organized with collections
Save and categorize content based on your preferences.
LayoutResultCallback
abstract class LayoutResultCallback
Base class for implementing a callback for the result of android.print.PrintDocumentAdapter#onLayout(android.print.PrintAttributes,android.print.PrintAttributes,android.os.CancellationSignal,android.print.PrintDocumentAdapter.LayoutResultCallback,android.os.Bundle)
.
Summary
Public methods |
open Unit |
Notifies that layout was cancelled as a result of a cancellation request.
|
open Unit |
Notifies that an error occurred while laying out the document.
|
open Unit |
Notifies that the layout finished and whether the content changed.
|
Public methods
onLayoutCancelled
open fun onLayoutCancelled(): Unit
Notifies that layout was cancelled as a result of a cancellation request.
onLayoutFailed
open fun onLayoutFailed(error: CharSequence!): Unit
Notifies that an error occurred while laying out the document.
Parameters |
error |
CharSequence!: The localized error message. shown to the user. May be null if error is unknown. |
onLayoutFinished
open fun onLayoutFinished(
info: PrintDocumentInfo!,
changed: Boolean
): Unit
Notifies that the layout finished and whether the content changed.
Parameters |
info |
PrintDocumentInfo!: An info object describing the document. Cannot be null . |
changed |
Boolean: Whether the layout changed. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PrintDocumentAdapter.LayoutResultCallback\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLayoutResultCallback\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/print/PrintDocumentAdapter.LayoutResultCallback \"View this page in Java\") \n\n```\nabstract class LayoutResultCallback\n```\n\n|---|--------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.print.PrintDocumentAdapter.LayoutResultCallback](#) |\n\nBase class for implementing a callback for the result of [android.print.PrintDocumentAdapter#onLayout(android.print.PrintAttributes,android.print.PrintAttributes,android.os.CancellationSignal,android.print.PrintDocumentAdapter.LayoutResultCallback,android.os.Bundle)](/reference/kotlin/android/print/PrintDocumentAdapter#onLayout(android.print.PrintAttributes,%20android.print.PrintAttributes,%20android.os.CancellationSignal,%20android.print.PrintDocumentAdapter.LayoutResultCallback,%20android.os.Bundle)).\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLayoutCancelled](#onLayoutCancelled())`()` Notifies that layout was cancelled as a result of a cancellation request. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLayoutFailed](#onLayoutFailed(kotlin.CharSequence))`(`error:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Notifies that an error occurred while laying out the document. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLayoutFinished](#onLayoutFinished(android.print.PrintDocumentInfo,%20kotlin.Boolean))`(`info:` `[PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo)!`, `changed:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Notifies that the layout finished and whether the content changed. |\n\nPublic methods\n--------------\n\n### onLayoutCancelled\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onLayoutCancelled(): Unit\n```\n\nNotifies that layout was cancelled as a result of a cancellation request. \n\n### onLayoutFailed\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onLayoutFailed(error: CharSequence!): Unit\n```\n\nNotifies that an error occurred while laying out the document.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!: The **localized** error message. shown to the user. May be `null` if error is unknown. |\n\n### onLayoutFinished\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onLayoutFinished(\n info: PrintDocumentInfo!, \n changed: Boolean\n): Unit\n```\n\nNotifies that the layout finished and whether the content changed.\n\n| Parameters ||\n|-----------|------------------------------------------------------------------------------------------------------------------------------------|\n| `info` | [PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo)!: An info object describing the document. Cannot be `null`. |\n| `changed` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): Whether the layout changed. |\n\n**See Also**\n\n- [android.print.PrintDocumentInfo](/reference/kotlin/android/print/PrintDocumentInfo)"]]