У меня есть код, я хочу изменить шрифт в списке и отобразить его в listadapter. однако это не помогает, а только показывает номер по умолчанию, а не реальные данные. Это правильный способ изменить шрифт моих данных?
ListAdapter adapter = new SimpleAdapter(
AllProductsActivity3.this, productsList,
R.layout.list_item3, new String[] { TAG_PID,
TAG_NAME, TAG_PRICE, TAG_DESCRIPTION},
new int[] { R.id.pid, R.id.username,R.id.p_title, R.id.approval }){
@Override
public View getView(int pos, View convertView, ViewGroup parent){
View v = convertView;
if(v== null){
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v=vi.inflate(R.layout.list_item3, null);
}
TextView tv = (TextView)v.findViewById(R.id.username);
Typeface custom_fontG = Typeface.createFromAsset(getAssets(),
"fonts/orange juice 2.0.ttf");
tv.setTypeface(custom_fontG);
TextView tv2 = (TextView)v.findViewById(R.id.p_title);
Typeface custom_fontH = Typeface.createFromAsset(getAssets(),
"fonts/orange juice 2.0.ttf");
tv2.setTypeface(custom_fontH);
TextView tv3 = (TextView)v.findViewById(R.id.approval);
Typeface custom_fontI = Typeface.createFromAsset(getAssets(),
"fonts/orange juice 2.0.ttf");
tv3.setTypeface(custom_fontI);
return v;
}