I have EditText and confirmation button. When I click on the button, the text is saved and EditText is disabled. However, underscores, which highlighted suggestions, remain visible. I need suggestions, so it's not an option to remove them. How can I remove underscores on button click?
Click listener for confirmation button:
buttonSave.setOnClickListener = {
// Hide keyboard
val keyboard = context.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
keyboard.hideSoftInputFromWindow(rootView.windowToken, 0)
// Show edit button
buttonEdit.visibility = View.VISIBLE
// Save text
onTextChanged(buttonSave.text.toString())
}
To be clear, the text looks like this after keyboard is hidden (except the button is missing):