In VB.NET i can execute code like this:

```
Sub Compute(sender As Object, e As EventArgs) Handle btnCompute.Click
 For i = 0 to IterationLimit
  ' Do something
  Applicaton.DoEvents()
 Next
End Sub

```

One iteration run approximately 50 ms, but whole method run - about 5 minutes. "Appliction.DoEvents()" allow system to correctly refresh form and allow user to perform action (press button Cancel, stroke hotkey etc). How I can something like in java for Android?