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()
....
}
}

--

--

--

Lead Android & iOS Mobile Engineer at Yahoo (Verizon Media) Taiwan https://www.linkedin.com/in/hanruyeh/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

SOFTWARE TESTING: MY PASSION, MY WAY

CS35L or CS97?

The Rise Of AI Code Autocompletion Engines — GitHub Autopilot, Tabnine, And Kite

A Day at Nava as a Frontend Developer

python-alpine and Postgres issues

Pattern Recognition & Waldo Trading

Salesforce Username — Naming Convention

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
Bram Yeh

Bram Yeh

Lead Android & iOS Mobile Engineer at Yahoo (Verizon Media) Taiwan https://www.linkedin.com/in/hanruyeh/

More from Medium

Changing The Function of The Navigation Button in ActionBar With Jetpack Navigation

Working with Multipart Form Data using Retrofit for Android

Integration of Huawei Site kit in Navigation Glove IoT application Using Kotlin — Part 3

Android WebView(Kotlin): handling Geolocation permission request