Java tutorial
//package com.java2s; /* * The MIT License (MIT) * Copyright (c) 2014 longkai * The software shall be used for good, not evil. */ import android.graphics.Typeface; import android.widget.TextView; public class Main { /** * helper method to check whether the typeface is null or not. * * @param textView * @param typeface */ public static void setTypeface(TextView textView, Typeface typeface) { if (typeface != null) { textView.setTypeface(typeface); } } }