1

私はアンドロイドに取り組んでいます。ログインページに送信ボタンがあり、正常に機能しています。次に、送信ボタンと同じ機能を持たせるために、Android キーボードの「完了」ボタン アクションを作成する必要があります。これどうやってするの?どんな助けでも事前に感謝します。

4

3 に答える 3

0

これを使用してみてくださいOnEditorActionListener

EditText edit = (EditText)findViewById(R.id.edit);

        edit.setOnEditorActionListener(new OnEditorActionListener() {
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
                    Log.i("check","Enter pressed");
                }    
                return false;
            }
        });
于 2013-05-31T10:43:26.667 に答える