我需要在EditText中捕获用户输入来删除字符,但是当我将InputType设置为textEmailAddress时,无法捕获事件中字符的删除,只能捕获中文输入法和韩文输入法。
XML
<AutoCompleteTextView
android:id="@+id/receiverEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@android:color/transparent"
android:completionThreshold="1"
android:imeOptions="actionNext"
android:inputType="textEmailAddress"
android:maxLength="50"
android:singleLine="true"
android:textAppearance="?
android:attr/textAppearanceMedium"
android:textColor="@color/new_mail_label_text_color" />
爪哇
mReceiverEdit.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
return false;
}
});