Added in API level 19

PrintJob

class PrintJob
kotlin.Any
   ↳ android.print.PrintJob

This class represents a print job from the perspective of an application. It contains behavior methods for performing operations on it as well as methods for querying its state. A snapshot of the print job state is represented by the PrintJobInfo class. The state of a print job may change over time. An application receives instances of this class when creating a print job or querying for its print jobs.

Summary

Public methods
Unit

Cancels this print job.

Boolean
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

PrintJobId?

Gets the unique print job id.

PrintJobInfo

Gets the PrintJobInfo that describes this job.

Int

Boolean

Gets whether this print job is blocked.

Boolean

Gets whether this print job is cancelled.

Boolean

Gets whether this print job is completed.

Boolean

Gets whether this print job is failed.

Boolean

Gets whether this print job is queued.

Boolean

Gets whether this print job is started.

Unit

Restarts this print job.

Public methods

cancel

Added in API level 19
fun cancel(): Unit

Cancels this print job. You can request cancellation of a queued, started, blocked, or failed print job.

equals

Added in API level 19
fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj This value may be null.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getId

Added in API level 19
fun getId(): PrintJobId?

Gets the unique print job id.

Return
PrintJobId? The id. This value may be null.

getInfo

Added in API level 19
fun getInfo(): PrintJobInfo

Gets the PrintJobInfo that describes this job.

Node:The returned info object is a snapshot of the current print job state. Every call to this method returns a fresh info object that reflects the current print job state.

Return
PrintJobInfo The print job info. This value cannot be null.

hashCode

Added in API level 19
fun hashCode(): Int
Return
Int a hash code value for this object.

isBlocked

Added in API level 19
fun isBlocked(): Boolean

Gets whether this print job is blocked. Such a print job is halted due to an abnormal condition. You can request a cancellation via cancel().

Return
Boolean Whether the print job is blocked.

See Also

isCancelled

Added in API level 19
fun isCancelled(): Boolean

Gets whether this print job is cancelled. Such a print job was cancelled as a result of a user request. This is a final state. You cannot restart such a print job.

Return
Boolean Whether the print job is cancelled.

isCompleted

Added in API level 19
fun isCompleted(): Boolean

Gets whether this print job is completed. Such a print job is successfully printed. You can neither cancel nor restart such a print job.

Return
Boolean Whether the print job is completed.

isFailed

Added in API level 19
fun isFailed(): Boolean

Gets whether this print job is failed. Such a print job is not successfully printed due to an error. You can request a restart via restart() or cancel via cancel().

Return
Boolean Whether the print job is failed.

isQueued

Added in API level 19
fun isQueued(): Boolean

Gets whether this print job is queued. Such a print job is ready to be printed. You can request a cancellation via cancel().

Return
Boolean Whether the print job is queued.

See Also

isStarted

Added in API level 19
fun isStarted(): Boolean

Gets whether this print job is started. Such a print job is being printed. You can request a cancellation via cancel().

Return
Boolean Whether the print job is started.

See Also

restart

Added in API level 19
fun restart(): Unit

Restarts this print job. You can request restart of a failed print job.

See Also