0
안드로이드 텍스트보기의 이름을 어떻게 동적으로 바꿀 수 있습니까? 이름이 이미 작성된 텍스트 뷰와 관련이 있어야 편집 텍스트 응답이 제공되는 것에 따라 이름을 지정하고 싶습니다. 인스턴스 이름이 이미 xml의 res id로 지정되어 있습니다. 예 최종 TextView 이름 a = (TextView) this.findViewById (R.id.Texti5);이름 바꾸기 android textview
editext.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if (keyCode==KeyEvent.KEYCODE_ENTER) {
if("test1".equalsIgnoreCase(anstext.getText().toString())) {
// Here i want to give textview1 the 'name a'
}}
else
if("test2".equalsIgnoreCase(editext.getText().toString())) {
// Here i want to give textview1 the 'name b'
}
if("test5".equalsIgnoreCase(editext.getText().toString())) {
// Here i want to give textview1 the 'name c'
}
if("test7".equalsIgnoreCase(editext.getText().toString())) {
// Here i want to give textview1 the 'name d'
}
if (editext.getText().toString() != null){
testwrong.seText("wrong"); }
}
// here i want to see what name is given and give the name to textview1 so i can
perform click on that textview as it is clickable
textview1.performClck();
return true;
} });