开发者

Disable keypad or whole keyboard support on android activity?

开发者 https://www.devze.com 2023-01-22 20:46 出处:网络
I have a layout with lots of different imagebuttons on it. Application is developed in full-touch, so there should be no response to keyboard or keypad on all activities except one, where user can inp

I have a layout with lots of different imagebuttons on it.

Application is developed in full-touch, so there should be no response to keyboard or keypad on all activities except one, where user can input his name.

Is there a way to achieve that?

I've checked on debug, keypress and keypad press result in onKeyDown event.

I've set it to return 'false' for all keys.

But, for some reason, android keeps selecting my imagebuttons when keypad is pressed.

And开发者_开发技巧 pressing Enter key result in View.onClick event.

How to totally disable all keyboard input for activity?

I use Motorola Milestone for tests - a slider with a keyboard

Thanks


Try using the android:windowSoftInputMode="stateAlwaysHidden" for the tag in the Manifest.xml file.

http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

0

精彩评论

暂无评论...
验证码 换一张
取 消