# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Inherited Methods

# FontsContract.FontRequestCallback

`public static class FontsContract.FontRequestCallback`
`extends Object` ``

java.lang.Object
↳ | android.provider.FontsContract.FontRequestCallback

Interface used to receive asynchronously fetched typefaces.

## Summary

### Constants
`int` | `FAIL_REASON_FONT_LOAD_ERROR` Constant returned by `onTypefaceRequestFailed(int)` signaling that the font returned by the provider was not loaded properly.
`int` | `FAIL_REASON_FONT_NOT_FOUND` Constant returned by `onTypefaceRequestFailed(int)` signaling that the font provider did not return any results for the given query.
`int` | `FAIL_REASON_FONT_UNAVAILABLE` Constant returned by `onTypefaceRequestFailed(int)` signaling that the font provider found the queried font, but it is currently unavailable.
`int` | `FAIL_REASON_MALFORMED_QUERY` Constant returned by `onTypefaceRequestFailed(int)` signaling that the given query was not supported by the provider.
`int` | `FAIL_REASON_PROVIDER_NOT_FOUND` Constant returned by `onTypefaceRequestFailed(int)` signaling that the given provider was not found on the device.
`int` | `FAIL_REASON_WRONG_CERTIFICATES` Constant returned by `onTypefaceRequestFailed(int)` signaling that the given provider must be authenticated and the given certificates do not match its signature.

### Public constructors
`FontRequestCallback()`

### Public methods
`void` | `onTypefaceRequestFailed(int reason)` Called when a Typeface request done via `FontsContract.requestFonts(Context, FontRequest, Handler, CancellationSignal, FontsContract.FontRequestCallback)`} fails.
`void` | `onTypefaceRetrieved(Typeface typeface)` Called then a Typeface request done via `FontsContract.requestFonts(Context, FontRequest, Handler, CancellationSignal, FontsContract.FontRequestCallback)` is complete.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### FAIL_REASON_FONT_LOAD_ERROR

    public static final int FAIL_REASON_FONT_LOAD_ERROR

Constant returned by `onTypefaceRequestFailed(int)` signaling that the font returned by the provider was not loaded properly.

Constant Value: -3 (0xfffffffd)

### FAIL_REASON_FONT_NOT_FOUND

    public static final int FAIL_REASON_FONT_NOT_FOUND

Constant returned by `onTypefaceRequestFailed(int)` signaling that the font provider did not return any results for the given query.

Constant Value: 1 (0x00000001)

### FAIL_REASON_FONT_UNAVAILABLE

    public static final int FAIL_REASON_FONT_UNAVAILABLE

Constant returned by `onTypefaceRequestFailed(int)` signaling that the font provider found the queried font, but it is currently unavailable.

Constant Value: 2 (0x00000002)

### FAIL_REASON_MALFORMED_QUERY

    public static final int FAIL_REASON_MALFORMED_QUERY

Constant returned by `onTypefaceRequestFailed(int)` signaling that the given query was not supported by the provider.

Constant Value: 3 (0x00000003)

### FAIL_REASON_PROVIDER_NOT_FOUND

    public static final int FAIL_REASON_PROVIDER_NOT_FOUND

Constant returned by `onTypefaceRequestFailed(int)` signaling that the given provider was not found on the device.

Constant Value: -1 (0xffffffff)

### FAIL_REASON_WRONG_CERTIFICATES

    public static final int FAIL_REASON_WRONG_CERTIFICATES

Constant returned by `onTypefaceRequestFailed(int)` signaling that the given provider must be authenticated and the given certificates do not match its signature.

Constant Value: -2 (0xfffffffe)

## Public constructors

### FontRequestCallback

    public FontRequestCallback ()

## Public methods

### onTypefaceRequestFailed

    public void onTypefaceRequestFailed (int reason)

Called when a Typeface request done via `FontsContract.requestFonts(Context, FontRequest, Handler, CancellationSignal, FontsContract.FontRequestCallback)`} fails.

Parameters
`reason` | `int`: One of `FAIL_REASON_PROVIDER_NOT_FOUND`, `FAIL_REASON_FONT_NOT_FOUND`, `FAIL_REASON_FONT_LOAD_ERROR`, `FAIL_REASON_FONT_UNAVAILABLE` or `FAIL_REASON_MALFORMED_QUERY` if returned by the system. May also be a positive value greater than 0 defined by the font provider as an additional error code. Refer to the provider's documentation for more information on possible returned error codes. Value is `FAIL_REASON_PROVIDER_NOT_FOUND`, `FAIL_REASON_FONT_LOAD_ERROR`, `FAIL_REASON_FONT_NOT_FOUND`, `FAIL_REASON_FONT_UNAVAILABLE`, or `FAIL_REASON_MALFORMED_QUERY`

### onTypefaceRetrieved

    public void onTypefaceRetrieved (Typeface typeface)

Called then a Typeface request done via `FontsContract.requestFonts(Context, FontRequest, Handler, CancellationSignal, FontsContract.FontRequestCallback)` is complete. Note that this method will not be called if `onTypefaceRequestFailed(int)` is called instead.

Parameters
`typeface` | `Typeface`: The Typeface object retrieved.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*