Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. et.addTextChangedListener(mTextEditorWatcher);
  2.  
  3.  
  4. private final TextWatcher mTextEditorWatcher = new TextWatcher() {
  5.  
  6. public void beforeTextChanged(CharSequence s, int start, int count, int after)
  7. {
  8.  
  9.  
  10. }
  11.  
  12. public void onTextChanged(CharSequence s, int start, int before, int count)
  13. {
  14. String name =et.getText().toString();
  15. String a ="a";
  16. String b ="b";
  17. String c ="c";
  18. String d ="d";
  19. String e ="e";
  20. String f ="f";
  21. String g ="g";
  22. String h ="h";
  23. String a1 ="u24B6";
  24. String b1 ="u24B7";
  25. String c1 ="u24B7";
  26. String d1 ="u24B9";
  27. String e1 ="u24BB";
  28. String f1 ="u24BB";
  29. String g1 ="u24BD";
  30. String h1 ="u24BD";
  31. name =name.replaceAll(a,a1);
  32. name =name.replaceAll(b,b1);
  33. name =name.replaceAll(c,c1);
  34. name =name.replaceAll(d,d1);
  35. name =name.replaceAll(e,e1);
  36. name =name.replaceAll(f,f1);
  37. name =name.replaceAll(g,g1);
  38. name =name.replaceAll(h,h1);
  39. tv.setText(name);
  40. }
  41.  
  42. public void afterTextChanged(Editable s)
  43. {
  44. et.removeTextChangedListener(this);
  45.  
  46. et.addTextChangedListener(this);
  47.  
  48. }
  49. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement