TP-63087 | open keyboard NPE crash fix (#10379)
This commit is contained in:
@@ -16,9 +16,11 @@ import android.view.inputmethod.InputMethodManager
|
||||
|
||||
fun openKeyboard(context: Context? = null, view: View, onFinish: () -> Unit) {
|
||||
post(view = view, delay = ANIMATION_DURATION) {
|
||||
val imm = context?.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT)
|
||||
post(view = view, delay = ANIMATION_DURATION, task = onFinish)
|
||||
context?.let {
|
||||
val imm = context.getSystemService(Activity.INPUT_METHOD_SERVICE) as? InputMethodManager
|
||||
imm?.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT)
|
||||
post(view = view, delay = ANIMATION_DURATION, task = onFinish)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user