我在我的应用程序中使用列表视图,我想要马拉地语列表视图项的字体,但出现某些错误并且应用程序关闭。这是我的代码:
public View getView(int position, View convertView, ViewGroup parent) {
View vi=convertView;
ViewHolder holder;
if(convertView==null){
/********** Inflate tabitem.xml file for each row ( Defined below ) ************/
vi = inflater.inflate(R.layout.tabitem, null);
/******** View Holder Object to contain tabitem.xml file elements ************/
holder=new ViewHolder();
holder.text.setTypeface(Typeface.createFromAsset(vi.getContext().getAssets(), "akshar.ttf"));
holder.text1.setTypeface(Typeface.createFromAsset(vi.getContext().getAssets(), "akshar.ttf"));
holder.text=(TextView)vi.findViewById(R.id.text);
holder.text1=(TextView)vi.findViewById(R.id.text1);
holder.image=(ImageView)vi.findViewById(R.id.image);
/************ Set holder with LayoutInflater ************/
vi.setTag(holder);
}