이전 텍스트를 잃지 않고 텍스트를 EditText에 추가하고 싶습니다.android의 나머지 텍스트에 텍스트를 추가하는 방법
예 :74
를 입력, 내가 이전에 입력 한 번호 "7"
를 지우지 않고 텍스트 상자에 "4"
을 추가 할 수 있습니다.
public void add4()
{
res = (EditText)findViewById(R.id.editText1);
if(res.getText().toString() == "0")
{
res.setText("4");
}
else
{
// add number 4 to the remaining string
}
}
사용'append' 대신'settext.' – Raghunandan
'res.append ("4")를 사용할 수 있습니다;' – Houcine