Quick Note: Custom WebView Class Won’t Display Virtual Keyboard After Kotlinized

TL;DR

public class CustomWebView extends WebView {    public CustomWebView(Context context) {
super(context);
initialize();
}
public CustomWebView(Context context, AttributeSet attrs) {
super(context, attrs);
initialize();
}
public CustomWebView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initialize();
}
private void initialize() {
// some configuration setting for CustomWebView
....
}
}
class CustomWebView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : WebView(context, attrs, defStyleAttr) {
init {
// some configuration setting for CustomWebView
// the same as previous method initialize()
....
}
}
class CustomWebView : WebView {    constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, @AttrRes defStyleAttr: Int) : super(context, attrs, defStyleAttr )
init {
// some configuration setting for CustomWebView
// the same as previous method initialize()
....
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store