android - Setting custom ttf font in preference activity -


i trying set custom ttf font inside preferenceactivity.

the preference activity contains 2 listpreferences, nothing else. inside preferenceactivity, have code:

protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     addpreferencesfromresource(r.xml.prefs);     preferencemanager.getdefaultsharedpreferences(this).registeronsharedpreferencechangelistener(this); }  public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) {     preference conpref = findpreference(key);      // works correctly, i'm able correct text form tv.gettext();             textview tv = (textview) conpref.getview(null, null).findviewbyid(android.r.id.title);      typeface gilfontbook = typeface.createfromasset(getassets(), "fonts/gilbook.ttf");     tv.settypeface(gilfontbook);  // doesnt change typeface } 

but doesn't work form me. fontface remains same before , after selecting item listpreference

as far know you've extend preferenceactivity class that. answer helped me:

https://stackoverflow.com/a/13193623/814353


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -