Saturday, September 5, 2009

Customize the soft keyboard

When you type something in Puzzle Pal, it is usually just a sequence of characters, not a valid word. The Android soft keyboard has auto-correct as default, which can be a bit annoying. Fortunately, you can customize the soft keyboard by specifying the input type of the TextView.

When I am expecting text, I use this:


Phone spell only accept digits, so I use this instead:


setInputType tells the system what you expect as your input. I picked visible password for text because that turns off auto correction. For phone spell, well, it is much more intuitive to offer a phone pad, isn't it?

No comments:

Post a Comment

Inline coding questions will not be answsered. Instead, ask on StackOverflow and put the link in the comment.