2016-07-27 5 views
-1

이 내 활동android and phone에 유니 코드를 추가 하시겠습니까?

String name =et.getText().toString(); 
      String a = "a"; 
      String a1 = "\u24B6"; 
      String b = "b"; 
      String b1 = "\u24B7"; 
      String c = "c"; 
      String c1 = "\u24B7"; 
      String d = "d"; 
      String d1 = "\u24B9"; 
      String e = "d"; 
      String e1 = "\u24BB"; 
      name = name.replaceAll(a,a1); 
      name = name.replaceAll(b,b1); 
      name = name.replaceAll(c,c1); 
      name = name.replaceAll(d,d1); 
      name = name.replaceAll(e,e1); 
      tv.setText(name); 

때 쓰기 a 또는 텍스트 뷰 솔루션은 무엇인가에 글고 쇼 공간에서 B 또는 C?

+2

불분명 함. 너 자신을 더 잘 설명해 주시겠습니까? –

+0

대체 문자열에 문자 대신 문자 사용 시도 –

답변

0

EditText에서 TextWatcher를 사용하십시오.

et.addTextChangedListener(new TextWatcher() { 
     @Override 
     public void onTextChanged(CharSequence s, int start, int before, int count) { 

      // TODO Auto-generated method stub 
     } 

     @Override 
     public void beforeTextChanged(CharSequence s, int start, int count, int after) { 

      // TODO Auto-generated method stub 
     } 

     @Override 
     public void afterTextChanged(Editable s) { 
      et.removeTextChangedListener(this); 
      // make changes to s here 
      et.addTextChangedListener(this); 
     } 
    }); 
+0

이 코드에 대한 의견을 입력하십시오. 텍스트 삽입보기 – pouyakarimdost

+0

결과에 변경이 없음 – pouyakarimdost

+0

텍스트보기 및 유니 코드로 코드를 작성하십시오. – pouyakarimdost