2

I'm writing an IME (soft keyboard) and I'm getting some weird behavior from one app (Android Mail). It is passing an unknown input class to my IME (via InputMethodService.onStartInputView(EditorInfo)):

EditorInfo.inputType & EditorInfo.TYPE_MASK_CLASS = 0xf

The problem is 0xf is not one of the input classes defined in EditorInfo! According to the docs the only legal values are 0x1, 0x2, 0x3 and 0x4. The ONLY text field that does this is the body field in the Android Mail app. Is this a bug in Android Mail or am I missing something?

Thanks in advance...

1 Answer 1

1
+50

Something like this happened to me while I developed an IME.

In my case the HTC Hero sent different input types than other devices in the default SMS application. At the moment we realized that the HTC Hero brought it's own custom IME so specific device logic should have been implemented.

My recommendation is the following:

  • If you want to support the device / application which sends this "special" input type just handle it differently.
  • Always check how the default android IME handles it.
  • Documentation states: If the class is not one you understand, assume TYPE_CLASS_TEXT with NO variation or flags.
Sign up to request clarification or add additional context in comments.

1 Comment

In other words, hack it. :) That's exactly what I'm doing now but I was hoping for a better explanation of the 0xf input class. However you've convinced me that only a few developers at Google probably know the true meaning and I'l just have to live with it.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.