how to add Go button in android SoftKeyBoard and its functionality?

前端 未结 4 756
渐次进展
渐次进展 2021-02-06 04:26

i want to put \"Go\" button in android appliation softkeyboard

for search and other related scenarios can any one guide me how to achieve this? with example.

any

4条回答
  •  醉话见心
    2021-02-06 05:11

    finally i used...

    EditText SearchEditText =(EditText)findViewById(R.id.txtMapSearch); 
    SearchEditText.setOnEditorActionListener(new OnEditorActionListener(){  
    
        @Override 
        public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) { 
            if(arg1 == EditorInfo.IME_ACTION_SEARCH)  
            { 
                // search pressed and perform your functionality.
            }
            return false; 
        } 
    
    }); 
    

提交回复
热议问题