I have mentioned pre-loaded fonts details as meta data in Android Manifest(as per the section Pre-declaring fonts in the manifest of Downloadable Fonts). I am able to use pre-loaded font in .xml file by app:fontFamily="@font/aladin" (here, xmlns:app="http://schemas.android.com/apk/res-auto")
But whenever I try to access pre-loaded font programmatically, I am getting the below exception: Caused by: android.content.res.Resources$NotFoundException: Font resource ID #0x7f090000
Code Snippet to access pre-loaded font: textView.setTypeface(ResourcesCompat.getFont(this, R.font.aladin));
Any help or guidance will be well appreciated.
If you have stored the font in resources
Your error indicates that you got some reference wrong, so you should check your references