报的是NULL POINTER EXCEPTION

解决方案 »

  1.   

    那3行代码改一下:LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v1 = inflater.inflate(R.layout.list_item1, null);
    TextView textall=(TextView) v1.findViewById(R.id.textAll);
    typeface=Typeface.createFromAsset(getAssets(),"font/MgOpenCosmeticaBold.ttf");
    textall.setTypeface(typeface);
      

  2.   

    谢谢你!用这代码不会报错能正常运行,不过字体还是没改成。
    程序的list_item1.xml 内容如下:
    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/textall"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="#0000ff"
    android:textStyle="italic"
    android:gravity="right"
    android:paddingLeft="6dip"android:minHeight="?android:attr/listPreferredItemHeight"
    />只有一个TEXTView。麻烦你了,这程序对我很重要,望你帮助
      

  3.   

    重写Arrayadapter 就行了。http://www.eoeandroid.com/blog-576315-1954.html
      

  4.   

    自己写adapter继承baseadapter吧
    在getview方法中设置textview的字体