java - MaskedEditText input to string -


hi have imported dependency github set's mask on input. can't seem input , convert string. trying diplay using textview activity.

activity_violator.java

public class violatordetail2 extends appcompatactivity{ @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activitiy_violator_detail2);     maskededittext maskededittext = (maskededittext)findviewbyid(r.id.masked_edit_text);     final string =maskededittext.gettext().tostring();      button btnconvert = (button) findviewbyid(r.id.btnconvert);     btnconvert.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {             textview b = (textview)findviewbyid(r.id.tvmasktry);             b.settext(a);         }     }); 

it returns ' - - ' values mask on button click.

xml file

<com.github.pinball83.maskededittext.maskededittext     android:id="@+id/masked_edit_text"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:inputtype="text"     app:mask="***-**-******"     app:notmaskedsymbol="*" /> 

ok, far searchet lib using should maskededittext#gettext().tostring(). should use in listener. not in oncreate method.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -