ソフトキーボード上のキーイベント:アンドロイド - 「入力」キャプチャ「完了」と記載された要素がある私は私のアプリで<strong>ログイン</strong>ページを持っている
- ユーザー名(のEditText)を
- パスワード( EditText)
- ログイン(ボタン)
Login
を押すことで、それがメイン画面に着陸する予定。ユーザがSamsung Galaxy S3
のソフトキーボードのパスワードのキー入力の完了時にDone
をヒットしたときに、同じアクションを実行することです。ソフトキーボードのEnter
キーはHTC One X
です。ここで私が試したどんな活動に
<EditText
android:id="@+id/password_txt"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:imeOptions="flagNoExtractUi"
android:inputType="textPassword"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="8dp"
android:singleLine="true" />
、されています:
だから、ここPasswordフィールドののEditTextがどのようにある
EditText mPassword = (EditText) findViewById(R.id.password_txt);
mPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_DONE){
Log.e("MyApp", " ------> IN EDITOR ACTION DONE");
}
return false;
}
});
私はパスワードのimeOptionsを維持してみましたフィールドをactionDone
とflagNoExtractUi
と一緒に入力しても問題ありませんでした。