Android.View.InflateException: Binary XML File Line #异常的解决

来源:互联网 发布:哪个挂号软件好用抢号 编辑:程序博客网 时间:2024/04/30 11:54

转载自:http://blog.csdn.net/l_serein/article/details/7400660

试了下,我是第二种情况解决的,果然包的名字是不对,直接粘过来的问题!!!!


Android.View.InflateException: Binary XML File Line #异常的解决


可能两种原因引起:

原因一:
   必须实现三个构造函数
    public GalleryFlow(Context context) {
            super(context);
    }

    public GalleryFlow(Context context, AttributeSet attrs) {
            super(context, attrs);
    }

    public GalleryFlow(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
    }
原因二:
   或者XML中包错!
   <com.yourpackege.yourLayout
          android:id="@+id/name"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:background="@color/transparent"/>
   中yourLayout这个类不在com.yourpackege中
0 0
原创粉丝点击