0
AndroidスタジオのEditTextフィールドにイベントリスナーを接続しようとしましたが、エラーが発生しました。ここに私のイベントリスナーです:シンボルを解決できません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;
}
});
、ここでのEditTextのための私のxmlです:
<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" />
私はwidget.TextView.OnEditorActionListenerをインポートしようとしましたが、Androidのメーカーはまだことを言っているsetOnEditorActionListenerシンボルは解決できません。
誰もが考えている?