To disable the paste suggestion feature on the on-screen keyboard for an EditText element, you can specify the "textNoSuggestions" value for the "android:inputType" attribute in the EditText's XML definition.
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions" />
Or you can set the inputType property programmatically in code:
EditText editText = findViewById(R.id.edit_text);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.