One way you can fix it is to put a class-level flag in your code. Set the flag when you are about to call setText() and clear it afterwards. Then, at the beginning of afterTextChanged(), check your flag. Something like this:
@Override
public void afterTextChanged(Editable editable) {
if (overridingText)
return;
if(count==2)
{
overridingText = true;
editClock.setText(editable.toString()+":");
overridingText = false;
}
else if(count==4)
{
overridingText = true;
editClock.setText(editable.toString()+".");
overridingText = false;
}
count++;
}
Perhaps Google has provided a better way to do this. I don't know if it, though.