Reputation: 1611
public class XYZ extends LinearLayout{
TextView text = (TextView) findViewById(R.id.kid_name);
Typeface font = Typeface.createFromAsset(getAssets(), "eng111.ttf");
text.setTypeface(font);
}
I just try to use the other format for the text and the problem is occurred "create the getAssets() method "
Where do I mistake ? please sort out this problem
Upvotes: 0
Views: 105
Reputation: 22064
You need a Context
, since you are not in an Activity
you need to call:
getContext().getAssets();
Upvotes: 2