2

I have an EditText using android:inputType="textPostalAddress" as the keyboard type. I would like it to default to the alt keyboard (SYM) which has numbers, and after the user hits space, switch back to the main alpha keyboard. I am using an OnKeyListener with a regex to check if a space has been entered. Is there a way to programmatically switch back and forth, simulating a SYM/ABC button press?

1 Answer 1

0

I have not tried but I believe it can solve ur problem:

InputMethodManager imm = InputMethodManager)getSystemService(AddContact.INPUT_METHOD_SERVICE);
imm.showSoftInputFromInputMethod(token, flags); 
1
  • I ended up just splitting the address number and street. Not an ideal solution for all cases, but the app usually autofills the street name using the current gps location, depending on accuracy. The code you posted looks familiar and I didn't have any luck with it, though I could be missing something trivial.
    – bezz
    Jul 29, 2011 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.