Understood the probelm. But still not find the solution
Its not sure that removeAllElements and addElement happens in one update. It may be happen in atleast two updates one for removal and one for addition. The blinking is caused by the brief time frame b/w the two updates.
Is there any way to make the update at once?