Der Versuch, einen Ereignis-Listener mit einem EditText-Feld in Android Studio zu verbinden, und es wird ein Fehler ausgegeben. Hier ist meine Event-Listener:Symbol kann nicht aufgelöst werden SetOnEditorActionListener
TextView editText = new TextView (this);
editText.setOnEditorActionListener (new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event){
if (actionId == EditorInfo.IME_ACTION_DONE)
{
//Write what you want to achieve
}
return false;
}
});
und hier ist mein xml für die EditText:
<EditText
android:id="@+id/etValue"
android:singleLine="true"
android:imeOptions="actionDone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="numberPassword"
android:password="true"
android:textAlignment="center"
android:layout_marginTop="84dp"
android:layout_below="@+id/textView"
android:layout_alignLeft="@+id/textView"
android:layout_alignStart="@+id/textView"
android:layout_alignRight="@+id/textView"
android:layout_alignEnd="@+id/textView" />
Ich habe versucht, den Import widget.TextView.OnEditorActionListener aber Android Studio immer noch sagt, dass der setOnEditorActionListener Symbol kann nicht aufgelöst werden.
Wer hat irgendwelche Ideen?