tags:

views:

120

answers:

2

How to i disable the keyboard when a button is pressesd.

+2  A: 

You want to disable or dismiss a virtual Keyboard?

If you want to just dismiss it you can use the following lines of code in your button's on click Event

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
Rahul
A: 

you can also use this code on button click event

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
Kandhasamy