Update Interface
<pre><code>public void parti(View view) {
    float sp = 0;
    long currentTime = 0, diffTime = 0;
    ImageView img = (ImageView) findViewById(R.id.i1);
    float a = 0;
    EditText et1 = (EditText) findViewById(R.id.editText1);
    et1.setText(Float.toString(a));
    currentTime = System.currentTimeMillis();
    do {
        a = img.getX();
        if (diffTime &gt; 150) {
            for (int i = 0; i &lt; 10; i++) {
                sp += (float) Math.random() * 5;
                img.setX(sp);
                diffTime = 0;
                currentTime = System.currentTimeMillis();
            }
        } else {
            diffTime = System.currentTimeMillis() - currentTime;
        }
    } while (a &lt; 600);
}
</code></pre>

<p>This is a fragment of code... I want to show every single step and not only the arrival one... how can I refresh every time I do a <code>SetX()</code>? </p>

<p>For understand I want to create an app which step by step it moves an image straight on the screen until it reach the margin of the screen... I need to show step by step because I'm going to create a game using this code.</p>
