Make sure you add all these constructors in your custom webview class.
public CustomWebView(Context context) {
super(context);
}
public CustomWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public CustomWebView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
And also don't forget to use this CustomWebView class in xml layout file with your complete package name.
<com.kittykitty.meowmeow.CustomWebView
android:id="@+id/my_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>