InflateException with custom View class

我们两清 提交于 2019-11-27 16:29:20

InflateException: Binary XML file line #6: Error inflating class com.example.highlight.ImageViewHighlight indicates the error is in ImageViewHighlight.

NoSuchMethodException indicates a method is missing.

<init> [class android.content.Context, interface android.util.AttributeSet] indicates the method missing is a constructor that takes a Context and an AttributeSet as parameters.

=> You need to implement this method by calling the super() with the same arguments.

public ImageViewHighlight(Context context, AttributeSet attrs) {
    super(context, attrs);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!