Skip to content

How to hide keyboard if press enter in keyboard ? or disable enter in keyboard ? #192

@afdaldev

Description

@afdaldev

i've try but don't work

chatView.setOnKeyListener { v, keyCode, event -> if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_DOWN) { Toast.makeText(this, "Enter", Toast.LENGTH_LONG).show() if (v != null) { val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager imm.hideSoftInputFromWindow(v.windowToken, 0) } window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) return@setOnKeyListener true } return@setOnKeyListener false }

or how to max input line 1 ?
i've try chatView.setMaxInputLine(1) but don't work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions