Hi,
I've tested the example, but the progressview doesn't show the progress if it's updated in a For Next cycle. See attached code. It updates only at the end of the cycle.
B4X:
For i = 0 To 1000
ProgressView1.Progress = ProgressView1.Progress + 1/1000
Log(ProgressView1.Progress)
Next
Someone can help me? What I'm doing wrong?
Thanks a Lot.
So the way is:
- to break the big For Next cycle into some small cyles,
- start everyone using a timer,
- update the progressview at the end of every cycle.
I'm doing a pdf file in the following way.
There are many diameter and thickness. The pdf may have about 600 lines and the creation takes about 20 seconds in release mode.
The Progressview update only at the end of sub Calc.
B4X:
Sub Calc
Unit = "a"
For diameter = 1 to ....
Cycle2
Next
Unit = "b"
For diameter = 1 to ....
Cycle2
Next
Unit = "c"
For diameter = 1 to ....
Cycle2
Next
End Sub
Sub Cycle2
For Thickness = 1 to ....
CalcParameters
Next
End Sub
Sub CalcParameters
' here the parameters are calculated
' according diameter and thickness
' and written in the pdf file in a new line
' of a table.
End Sub
Because this doesn't work, the progressview doesn't update in release nor in debug mode.
But if I put a breakpoint on the line where the progressview is increased, I can see the progressview increasing after every break.