I need to close the keyboard when a user presses a submit button so the data behind the keyboard can be seen. Here is how I have the button wired, but its not working.
Any ideas?
Button clearbutton = (Button)findViewById(R.id.Submitbutton);
Submitbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
{
//...etc...
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
Something like this should work (also, see this post).