Possible Duplicate:
How to clear/empty Java Stringbuilder
I'm adding values to a string and then displaying it in a text view, but when I refresh the page it doesn't clear the string first.
It just keeps adding to it.
Is there a way to clear a string builder in android?
What I have tried so far
StringBuilder sb = new StringBuilder();
sb.delete(0,sb.length());
for (String s : awayScores)
{
sb.append(s);
sb.append("\n");
}
StringBuilder sb2 = new StringBuilder();
sb2.delete(0,sb2.length());
for (String h : homeScores)
{
sb2.append(h);
sb2.append("\n");
}
String awayeve = sb.toString();
String homeeve = sb2.toString();
Log.v("home", "homeeve" + homeeve);
Log.v("home", "awayeve" + awayeve);