android - Font Awesome doesn't work with direct string input -
i want set font awesome 1 text view in application. used below , works fine:
typeface font = typeface.createfromasset( getassets(), "fontawesome/fonts/fontawesome-webfont.ttf" ); textview awesomebutton = (textview)findviewbyid(r.id.awesome_button); awesomebutton.settypeface(font); awesomebutton.settext(mainactivity.this.getstring(r.string.heart));
but when want use below cod, doesn't work:
typeface font = typeface.createfromasset( getassets(), "fontawesome/fonts/fontawesome-webfont.ttf" ); textview awesomebutton = (textview)findviewbyid(r.id.awesome_button); awesomebutton.settypeface(font); awesomebutton.settext("");
try this
typeface font = typeface.createfromasset( getassets(), "fontawesome/fonts/fontawesome-webfont.ttf" ); textview awesomebutton = (textview)findviewbyid(r.id.awesome_button); awesomebutton.settypeface(font); awesomebutton.settext(html.fromhtml(""));
Comments
Post a Comment