How to avoid android view inflate exception?

前端 未结 1 1262
粉色の甜心
粉色の甜心 2020-12-20 01:53

I have created a class that extends surface view and declared in XML also. But upon executing its throwing error

This is my XML declarations



        
1条回答
  •  一整个雨季
    2020-12-20 02:37

    you missed a constructor,

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

    Edit:

    This is the constructor that is called when the view is inflated (constructed) from the xml. The attributes you declared are supplied by the second parameter

    0 讨论(0)
提交回复
热议问题