Although the IMF has provided EditorInfo to get the attributes of components with focus. However, the attributes is not fully.
First of all, we could not distinguish between Button and EditText components, they have the same InputType value "EditorInfo.TYPE_CLASS_TEXT" Secondly,after the EditText was been setEditable (false), it should not be editeable, but through the input method, you can still enter text, because IMF still get a InputConnection associated with that EditText. ---------------------------------------------------------------------------------------------------------------------- IMF虽然提供了EditorInfo来获得当前焦点组件的属性。 但是该属性不全面, 首先不能区分普通的Button和EditText组件,他们的inputType值竟然都是1,Button可输入? 其次,对应EditText设置了setEditable(false)后,是不可编辑的,但是通过输入法,仍然可以输入文字,因为IMF中获得 InputConnection中可没有判断是不是可编辑的。 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---