@@ -0,0 +1,1338 @@
+package com.chobitech.android.lib.components;%0A%0Aimport android.content.Context;%0Aimport android.content.res.TypedArray;%0Aimport android.graphics.Typeface;%0Aimport android.util.AttributeSet;%0Aimport android.widget.TextView;%0A%0Aimport com.chobitech.android.lib.R;%0A%0Apublic class TtfTextView extends TextView %7B%0A%0A%09private Context mContext;%0A%0A%09public TtfTextView(Context context) %7B%0A%09%09super(context);%0A%09%09mContext = context;%0A%09%7D%0A%09public TtfTextView(Context context, AttributeSet attrs) %7B%0A%09%09super(context, attrs);%0A%09%09mContext = context;%0A%09%09init(attrs, R.styleable.TtfTextView_ttfTextViewFontFile);%0A%09%7D%0A%09public TtfTextView(Context context, AttributeSet attrs, int defStyleArrt) %7B%0A%09%09super(context, attrs, defStyleArrt);%0A%09%09mContext = context;%0A%09%09init(attrs, defStyleArrt);%0A%09%7D%0A%0A%09private void init(AttributeSet attrs, int defStyleAttr) %7B%0A%09%09TypedArray arr = mContext.obtainStyledAttributes(attrs, R.styleable.TtfTextView, defStyleAttr, 0);%0A%09%09String ttfName = arr.getString(R.styleable.TtfTextView_ttfTextViewFontFile);%0A%09%09%0A%09%09/*%0A%09%09* the following code is a cause of the exception%0A%09%09*/%0A%09%09//setTypeface(Typeface.createFromAsset(mContext.getAssets(), ttfName));%0A%09%09%0A%09%09/*%0A%09%09* the fixed code with the class %22TtfFontHolder, is a singleton and holds instances of TypeFace%0A%09%09*/%0A%09%09setTypeface(TtfFontHolder.getInstance().getTypeFace(mContext, ttfName));%0A%09%09%0A%09%09arr.recycle();%0A%09%7D%0A%7D%0A

Create TtfTextView.java