Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/print/PrintDocumentAdapter.LayoutResultCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/print/PrintDocumentAdapter.LayoutResultCallback#inhmethods)

# PrintDocumentAdapter.LayoutResultCallback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/print/PrintDocumentAdapter.LayoutResultCallback "View this page in Kotlin") \|Java


`
public
static

abstract
class
PrintDocumentAdapter.LayoutResultCallback
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.print.PrintDocumentAdapter.LayoutResultCallback |

<br />

*** ** * ** ***

Base class for implementing a callback for the result of `https://developer.android.com/reference/android/print/PrintDocumentAdapter#onLayout(android.print.PrintAttributes,%20android.print.PrintAttributes,%20android.os.CancellationSignal,%20android.print.PrintDocumentAdapter.LayoutResultCallback,%20android.os.Bundle)`.

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/print/PrintDocumentAdapter.LayoutResultCallback#onLayoutCancelled()() ` Notifies that layout was cancelled as a result of a cancellation request. |
| ` void` | ` https://developer.android.com/reference/android/print/PrintDocumentAdapter.LayoutResultCallback#onLayoutFailed(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence error) ` Notifies that an error occurred while laying out the document. |
| ` void` | ` https://developer.android.com/reference/android/print/PrintDocumentAdapter.LayoutResultCallback#onLayoutFinished(android.print.PrintDocumentInfo,%20boolean)(https://developer.android.com/reference/android/print/PrintDocumentInfo info, boolean changed) ` Notifies that the layout finished and whether the content changed. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### onLayoutCancelled

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onLayoutCancelled ()
```

Notifies that layout was cancelled as a result of a cancellation request.

<br />

### onLayoutFailed

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onLayoutFailed (CharSequence error)
```

Notifies that an error occurred while laying out the document.

<br />

| Parameters ||
|---|---|
| `error` | `CharSequence`: The **localized** error message. shown to the user. May be `null` if error is unknown. <br /> |

### onLayoutFinished

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onLayoutFinished (PrintDocumentInfo info, 
                boolean changed)
```

Notifies that the layout finished and whether the content changed.

<br />

| Parameters ||
|---|---|
| `info` | `PrintDocumentInfo`: An info object describing the document. Cannot be `null`. <br /> |
| `changed` | `boolean`: Whether the layout changed. <br /> |

**See also:**

- `https://developer.android.com/reference/android/print/PrintDocumentInfo`