tags:

views:

56

answers:

2
+1  Q: 

android edittext

I have one edittext EditText et1=(EditText)findViewById(R.id.EditText01);

when i want to clear edittext i use et1.setText(""); but if i have to clear edittext one by one character from the last for this i have no solution can u pls give me solution

+1  A: 

Do you know about SubString?

String contents = et1.getText().toString();
et1.setText(contents.substring(0, contents.length()-2));
Ankit Jain
thanx it works for me
bindal
A: 

Well, if you know what you want to clear you can get the text from the edittext and then remove the amount of characters from the end using string.substring(0,numOfEND);

b0ng01