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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ResourcesCompat.FontCallback\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1 \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nResourcesCompat.FontCallback\n============================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\nstatic\n\nabstract\nclass\nResourcesCompat.FontCallback\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.v4.content.res.ResourcesCompat.FontCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface used to receive asynchronous font fetching events.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[ResourcesCompat.FontCallback](/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#ResourcesCompat.FontCallback())`() ` |\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onFontRetrievalFailed](/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#onFontRetrievalFailed(int))`(int reason) ` Called when an asynchronous font failed to load. |\n| ` abstract void` | ` `[onFontRetrieved](/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#onFontRetrieved(android.graphics.Typeface))`(`[Typeface](https://developer.android.com/reference/android/graphics/Typeface.html)` typeface) ` Called when an asynchronous font was finished loading. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### ResourcesCompat.FontCallback\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nResourcesCompat.FontCallback ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onFontRetrievalFailed\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onFontRetrievalFailed (int reason)\n```\n\nCalled when an asynchronous font failed to load.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `reason` | `int`: The reason the font failed to load. One of [FAIL_REASON_PROVIDER_NOT_FOUND](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_PROVIDER_NOT_FOUND), [FAIL_REASON_WRONG_CERTIFICATES](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_WRONG_CERTIFICATES), [FAIL_REASON_FONT_LOAD_ERROR](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_LOAD_ERROR), [FAIL_REASON_SECURITY_VIOLATION](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_SECURITY_VIOLATION), [FAIL_REASON_FONT_NOT_FOUND](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_NOT_FOUND), [FAIL_REASON_FONT_UNAVAILABLE](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_UNAVAILABLE) or [FAIL_REASON_MALFORMED_QUERY](/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_MALFORMED_QUERY). \u003cbr /\u003e |\n\n### onFontRetrieved\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onFontRetrieved (Typeface typeface)\n```\n\nCalled when an asynchronous font was finished loading.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------------|\n| `typeface` | `Typeface`: The font that was loaded. \u003cbr /\u003e |\n\n-\n\n Classes\n -------\n\n - [ConfigurationHelper](/reference/android/support/v4/content/res/ConfigurationHelper)\n - [ResourcesCompat](/reference/android/support/v4/content/res/ResourcesCompat)\n - [ResourcesCompat.FontCallback](/reference/android/support/v4/content/res/ResourcesCompat.FontCallback)"]]