Since upgrading my Nexus 5X to Android N, I have the following crash when using EditText:
java.lang.UnsupportedOperationException: Failed to resolve attri
In the stack trace there was a reference to SuggestionsPopupWindow that made me think of disabling suggestions for EditText.
I used the following code as a workaround:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
if ((editText.getInputType() & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) != InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) {
editText.setInputType(editText.getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}
}
We can also set inputType in XML, but the above code allows us to add TYPE_TEXT_FLAG_NO_SUGGESTIONS to existent input type.