I'm using Android Studio 1.0 RC 1 and I'm having trouble inflating a view class in xml file. I have a view file which extends GridView and which contains all 3 constructors:
package app.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
public class ImageSeGridView extends GridView {
public ImageSeGridView(Context context) {
super(context);
init();
}
public ImageSeGridView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public ImageSeGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init() {
//....
}
}
and I'm adding this view inside xml class:
<app.views.ImageSeGridView
android:id="@+id/image_search_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
I'm not getting any complains at compile time, but at running I receive the following error:
android.view.InflateException: Binary XML file line #13: Error inflating class app.views.ImageSeGridView
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
and I do not know how to solve this issue. This does not occur when using IntelliJ IDEA 13 for example, happens only when using Android Studio.
No comments:
Post a Comment