Android: Disable SoftKeyboard in MultiLine EditText
Need some help to enable multiple lines i开发者_JAVA百科n EditText WITHOUT permiting softkeyboard to open.
I DON'T use android's native softkeyboard. I have my own "softkeyboard" as a view inside activity.
I've tried these solutions, but they DID NOT WORK:
Disable SoftKeyboard in MultiLine EditText android
how to block virtual keyboard while clicking on edittext in android?
(Similar) EditText with textPassword inputType, but without Softkeyboard
This solution works fine for Android 2 but doesn't work for SOME Android 4 phones (And I don't really know why):
<EditTextExtension
a:editable="false"
a:singleLine="false"/>
Class EdiTextExtension should override onCheckIsTextEditor() method:
@Override
public boolean onCheckIsTextEditor() {
if ( Build.VERSION.SDK_INT >= 11 ) {
// resulting false for Android >= 11 will hide cursor
// NOTE: this code works fine only with SOME devices and not all (WHY?)
return true;
} else {
return false;
}
}
精彩评论