Unable to start activity ComponentInfo

在XML中添加自定义view的时候出现下面异常:

Unable to start activity ComponentInfo{com.example.xxx.hexagon/com.example.xxx.hexagon.MainActivity}: android.view.InflateException: Binary XML file line #7: Binary XML file line #7: Error inflating class com.example.xxx.hexagon.CircularImages

1、先检查包名是否正确com.example.xxx.hexagon.CircularImages

2、补齐这个构造器,异常消失了,如果碰到不妨试试看。

public CircularImages(Context context, AttributeSet attrs) {       

super(context, attrs);   

}

你可能感兴趣的:(Unable to start activity ComponentInfo)