Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android remoteViews custom font

Tags:

android

How I can set custom font in my widget ?

remoteViews.setTextViewText(R.id.text1,""+ days);

Can someone show me an example of how to set the font for this?

like image 791
Goliathus Avatar asked Nov 15 '12 17:11

Goliathus


People also ask

What is Remoteview in Android?

android.widget.RemoteViews. A class that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.


1 Answers

How I can set custom font in my widget ?

You don't. You can choose one of the three built-in typefaces in your layout XML via android:typeface, but you cannot use a custom font with a TextView in a RemoteViews. setTypeface(), the Java method for specifying a custom font on a TextView, is not available for RemoteViews.

like image 196
CommonsWare Avatar answered Oct 04 '22 17:10

CommonsWare