tags:

views:

255

answers:

3

dear friends,

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 help would be appriciated.

+1  A: 

See this question from a couple of days ago:
http://stackoverflow.com/questions/2568637/how-to-disable-next-button-on-a-edittext-software-keyboard-replace-with-done

Christopher
it only closes the soft keyboard..i havean EditText along with button i want to implement that button associated with search EditText functionality on clicking this softkeyboard done button.
UMMA
A: 

If your question is that you have an EditText or editable TextView, and you want the action right button on the softkeyboard to read "Go" then add this attribute to your EditText/TextView

android:imeActionLabel="actionGo"

note that it will also have to be a single line TextView as otherwise the action button will be a carriage return selector (an arrow).

android:singleLine="true" 
Jim Blackler
actually i want to perform functionality like pressing search button on activity on this soft key board button.
UMMA
A: 

finally i used...

EditText   SearchEditText =(EditText)findViewById(R.id.txtMapSearch); 
         SearchEditText.setOnEditorActionListener(new OnEditorActionListener(){  



            @Override 
            public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) { 
                // TODO Auto-generated method stub 
                 if(arg1 == EditorInfo.IME_ACTION_SEARCH)  
                 { 

                  // search pressed and perform your functionality.                    
                 } 
                 return false; 
            } 

         }); 
UMMA