Android OnEditorActionListener() actionId give 0 when I click Done key

前端 未结 2 1691
不思量自难忘°
不思量自难忘° 2021-02-06 00:51

I have created one keyboard.When user enter numbers , its entering particular EditText.But When User click on Done key, it didn\'t go to setOnEditorActionList

2条回答
  •  一个人的身影
    2021-02-06 01:34

    Try this for adding Listener :

        msg_title_text.setOnEditorActionListener(new DoneOnEditorActionListener());
    

    Created a class :

        class DoneOnEditorActionListener implements OnEditorActionListener {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                Log.v("*****************************", "Clicke da machan");
                // Do your Stuffs
                return true;    
            }
            return false;
        }
    }
    

提交回复
热议问题