リストされている要素があるアプリにログインページがあります。
- ユーザー名 (EditText)
- パスワード (EditText)
- ログイン(ボタン)
を押すLogin
と、メイン画面に着陸します。Done
これは、ユーザーがソフト キーボード オンでパスワード入力の完了時にヒットしたときに、同じアクションを実行することを目的としていますSamsung Galaxy S3
。とEnter
ソフトキーボードのキーをオンにしHTC One X
ます。
したがって、パスワードフィールドの EditText は次のようになります。
<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" />
アクティビティでは、私が試したものはすべてここにあります:
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;
}
});
Password フィールドの imeOptions を と一緒に保持しようとしましたが、うまくいきactionDone
ませflagNoExtractUi
んでした。