質問

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...

役に立ちましたか?

解決

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.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top