android - Keep a part of edittext uneditable -
in app have couple of checkboxes, when checked combine first part of edittext. in same edittext allow user append text, while disallowing delete built text.
this how looks [this part build checkbox combination, , can change in real time][this part user defined]
now there way not allow user modify first part of edittext, still allow app change text?
you can create textwatcher object , add edittext. in textwatcher, can store constant text information in instance variable. then, can fill in ontextchanged() , aftertextchanged() methods create type of behavior looking for.
for example, can check cursor position (using edittext.getselected()) see if user tried change of text shouldn't changed-- if do, have code handle case.
i know isn't best answer, don't yet have privilege make comment. hope helps!
Comments
Post a Comment