android - Dynamically disable auto-capitalization of an EditText -
i dynamically creating edittext
, want disable auto-capitalization on sentences (new lines).
i have tried variation of flags edittext.setinputtype(int)
none of them have accomplished disabling shift key being enabled on new lines.
here code:
sharedpreferences preferences = preferencemanager.getdefaultsharedpreferences(context); edittext edittext = new edittext(context); int type = inputtype.type_class_text | inputtype.type_text_flag_multi_line | inputtype.type_text_flag_ime_multi_line; if (preferences.getboolean("disable_suggestions", true)) { type |= inputtype.type_text_flag_no_suggestions | inputtype.type_text_variation_visible_password; } if (preferences.getboolean("disable_auto_capitalization", true)) { // // todo: stackoverflow rescue! flag need? // } edittext.setinputtype(type);
i have searched stackoverflow extensively answer , question found this.
as @commonsware pointed out, doing should ok. impossible guarantee disabled auto-capitalization across devices.
if user using third-party keyboard, swiftkey, may override disabling auto-capitalization; user have manually in third-party app settings.
Comments
Post a Comment