tags:

views:

440

answers:

2

I'm developing and Android app using the 1.6 sdk. I'm using a TimePicker and I don't want the soft keyboard to come up when you click on the digits in the TimePicker. I only want the TimePicker to be changed using the plus and minus buttons. I've tried using android:focusable="false" and android:focusableInTouchMode="false" hoping those would do it, but they didn't seem to do anything. Is there a way to do this?

A: 

You can do this:

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

Please refer to this question as well:

http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard

MexicanHacker
This doesn't work for the TimePicker. I've done that before with an EditText. Also, I don't just want a way to hide the soft keyboard, but basically to make the EditTexts inside the TimePicker to never have focus. I only want the values to be changed using the plus and minus buttons, and I don't want the user to be able to click in the area where the numbers are and have a cursor come up. I've been trying to figure out how to get a reference to those children inside the TimePicker to do this...but I cannot figure out how.
ashughes