Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>follow this method your problem would be solved then</p> <p><a href="http://www.shaikhhamadali.blogspot.com/2013/06/how-to-apply-niccustom-format-to-edit.html" rel="nofollow">http://www.shaikhhamadali.blogspot.com/2013/06/how-to-apply-niccustom-format-to-edit.html</a></p> <p>like this solution,you should also chech the length of you text on backspace.</p> <p>mark this as answer for others help.</p> <pre><code> //get the reference of this edit text field EditText etNICNO_Sender=(EditText)findViewById(R.id.etNICNO_Sender); /*add textChangeListner with TextWatcher argument by adding text change listner with text watcher we can get three methods of Edit Text 1) onTextChanged 2) beforeTextChanged 3) afterTextChanged these methods work when user types in text feild. */ etNICNO_Sender.addTextChangedListener(new TextWatcher() { int len=0; @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub String str = etNICNO_Sender.getText().toString(); if((str.length()==3 &amp;&amp; len &lt;str.length()) || (str.length()==7 &amp;&amp; len &lt;str.length())){ //checking length for backspace. etNICNO_Sender.append("-"); //Toast.makeText(getBaseContext(), "add minus", Toast.LENGTH_SHORT).show(); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub String str = etNICNO_Sender.getText().toString(); len = str.length(); } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload