Tutorial by Examples

ArrayList<String> fontNames = new ArrayList<String>(); File temp = new File("/system/fonts/"); String fontSuffix = ".ttf"; for(File font : temp.listFiles()) { String fontName = font.getName(); if(fontName.endsWith(fontSuffix)) { fontNames.add(f...
In the following code you need to replace fontsname by the name of the font you would like to use: TextView lblexample = (TextView) findViewById(R.id.lblexample); lblexample.setTypeface(Typeface.createFromFile("/system/fonts/" + "fontsname" + ".ttf"));

Page 1 of 1