Android AlertDialog Show Keyboard When Shown

July 24, 2018
val dialog = AlertDialog.Builder(context)
        .setTitle(title)
        .setView(view)
        .setPositiveButton(android.R.string.ok) { _, _ ->

        }
        .setNegativeButton(android.R.string.cancel) { _, _ ->

        }
        .create()

dialog.window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)

dialog.show()
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.