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中