java - Unable to change default font in Android app -
i trying change default font in app. not working. these steps have taken: 1) created class typefaceutil.java import android.content.context; import android.graphics.typeface; import android.util.log; import java.lang.reflect.field; public class typefaceutil { public static void overridefont(context context, string defaultfontnametooverride, string customfontfilenameinassets) { try { final typeface customfonttypeface = typeface.createfromasset(context.getassets(), customfontfilenameinassets); final field defaultfonttypefacefield = typeface.class.getdeclaredfield(defaultfontnametooverride); defaultfonttypefacefield.setaccessible(true); defaultfonttypefacefield.set(null, customfonttypeface); } catch (exception e) { log.e("customfontexception", "can not set custom font " + customfontfilenameinassets + " instead of " + defaultfontnametooverride); } } } 2) in class extending application : publ...