如何在Android中以编程方式停止电子邮件输入类型的edittext自动建议

log*_*i98 5 android autosuggest android-edittext

如何在输入类型为textEmailAddress的情况下禁用自动建议,在使用类似下面的自动建议时,将要停止使用电子邮件键盘的自动建议。

使用的代码

<EditText
    android:hint="Logesh"
    android:inputType="textEmailAddress|textNoSuggestions|textMultiLine "
    android:layout_width="match_parent"
    android:importantForAutofill="no"
    android:layout_height="match_parent" />
Run Code Online (Sandbox Code Playgroud)

我也在下面尝试了

<EditText
    android:hint="Logesh"
    android:inputType="textEmailAddress|textVisiablePassword"
    android:layout_width="match_parent"
    android:importantForAutofill="no"
    android:layout_height="match_parent" />
Run Code Online (Sandbox Code Playgroud)

使用textVisiblePassword键盘“ @”的输入时未显示。

提前致谢 !

小智 2

将其添加到您的 EditText 中 -

android:inputType="textFilter|textEmailAddress|textNoSuggestions"
Run Code Online (Sandbox Code Playgroud)

并删除 android:importantForAutofill="no"