title: Android Edit text Masking
body: <p>I want to add masking .. 
  like 00000-0000000-0</p>
  
  <pre><code>etusercnic.addTextChangedListener(new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {
          }
  
          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
              try {
                  String str = s.toString();
                  if (s.length() == 5 || s.length() == 13) {
                      str += "-";
                      etusercnic.setText(str);
                      etusercnic.setSelection(str.length());
                  }
              } catch (Exception ignored) {
              }
          }
  
          @Override
          public void afterTextChanged(Editable s) {
          }
      });
  </code></pre>
  
  <p>It works perfectly,when first time i entered the value, but when i remove any digit it placed - sign. so what can i do.. </p>