Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically Set Font Icon from Code using FontAwesome without String.xml

I am trying to load font icon using fontawesome.ttf in a textView. If i set the string value like  through string.xml then it works file and Icon is shown. But if the same text "" is set programatically as textView.setText("") then it doesn't show the icon , rather the same text is shown on textview.

Any alternative approach to show icons programatically without referring string.xml file ?

like image 207
Atmaram Avatar asked Jan 07 '15 18:01

Atmaram


People also ask

Can I upload my own icons to Font Awesome?

Now with the magic of Kits, you can upload your own icons and use them right alongside official Font Awesome ones!


1 Answers

Try using the Unicode code... \uf007.
This should work just fine:

textView.setText("\uf007");
like image 57
Phantômaxx Avatar answered Sep 21 '22 04:09

Phantômaxx