The problem I am facing is specific to Android 5.0 (including 5.0.1 / 5.0.2) on both phones and on my tablet (Nexus 9). Earlier versions of Android work fine.
In my application, I want to install a global font that cancels all text. The way I ran this before 5.0 used this method . This font override method does not work on any version of Lollipop that I tried, but works fine in versions 2.x and 4.x. I also run this code in the class BaseApplicationthat I have, so the font is initialized only in onCreate()mine BaseApplication.
This seems to be a bug in the Preview Preview and was reported here . I tried to fix the suggestion in article 16 to use the TTX tool to convert your font file to .ttx and back to .otf, but this does not seem to fix the problem, as it did for others. I also confirmed that my .otf font file is valid and not corrupted by the OTS disinfection tool.
I also have a custom TextView that I can set in font through the layout. An example is:
<com.myapp.widgets.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Testing text view font"
myapp:fontName="my-font.otf" />
CustomTextView setTypeface(typeFace) . 5.0, , , TextView, EditText .., CustomTextView .
, TextView CustomTextView Android, .
, , - Material Holo, , android:typeface. , Material - android:typeface , .
, !