I am making an app in which my class extends RelativeLayout and implements OnClickListener But my problem is that i am not able to set TypeFace in that its giving Exception
public class Viewnew extends RelativeLayout implements OnPageChangeListener {
Context mContext;
and when i use
Typeface tf=Typeface.createFromAsset(mContext.getAssets(), "fonts/trbuc.ttf");
I am getting exception at mContext and exception is as follows:
E/AndroidRuntime(15203): Caused by: java.lang.RuntimeException: native typeface cannot be made
E/AndroidRuntime(15203): at android.graphics.Typeface.<init>(Typeface.java:240)
E/AndroidRuntime(15203):at android.graphics.Typeface.createFromAsset(Typeface.java:214)
I used .otf in place of .ttf and it worked.Thanks everyone for help