Android Question CircularProgressBar in For Next Look doesn't update

GeoffT660

Active Member
Licensed User
Longtime User
I have a For Next loop that updates each record in a table given a certain condition but the circularprogressbar won't update when the value is updated in the loop. The CircularProgressBar also won't show visible even if I make it visible in code before I start the For Next Loop. I also have this issue with sweetalertdialog. Please let me know what I am doing wrong.

B4X:
Starter.sqlBN.BeginTransaction
Try
  For i = 0 To Cursor1.RowCount - 1
  Cursor1.Position = i
  Query = "UPDATE Table Set STATUS = ? WHERE AssetNo = " &  Cursor1.GetInt("ASSETNO")
  Starter.sqlBN.ExecNonQuery2(Query, Array As String("T1")
  cpbIB.Value = I   'CustomProgressBar value
Next
  Starter.sqlBN.TransactionSuccessful
  Catch
  Log(LastException.Message)
End Try
Starter.sqlBN.EndTransaction
Cursor1.Close
 

GeoffT660

Active Member
Licensed User
Longtime User
Why is this a better option? I see that the post says it doesn't work with sqlCipher and that's what I am using. Is that still the case?
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
I gave this a try and it just hangs on the Wait for Statement and I still need the Sleep(0). I am using an Update statement like above, not sure if that makes a difference. I'm on sqlcipher library 1.50.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I gave this a try and it just hangs on the Wait for Statement and I still need the Sleep(0)
It doesn't hand on the wait for statement. You need to learn about resumable subs.

Everything continues to run and when the operation completes it will continue after the wait for statement.
 
Upvote 0
Top