Reputation: 130
I decided to use Downloadable fonts in my project. I implemented everything as recommened in the guide.
The following problem occured, when i tried to get font from ResourcesCompat next way:
ResourcesCompat.getFont(MainActivity.this, R.font.roboto_bold)
After that, i always get this exeption:
Font resource ID #0x7f090005 could not be retrieved
How to solve this problem?
PS:
Upvotes: 4
Views: 1600
Reputation: 26
Quote from https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html#via-android-studio:
You can set your application to download fonts by using Android Studio 3.0. To help you get started with the Downloadable Fonts features, you can use the font provider from Google Play services.
Note: A device must have Google Play services version 11 or higher to use the Google Fonts provider.
Upvotes: 1