hi,
start a new b4j project, add a TableView (designer), change the 'Sub Button1_Click' code :
run the program, click the button, watch the LOG.
the 1-105 loop is just to replace 105 button manuel clicks, each updating the table.
in my machine, after i=100, there's an error in the log. the Table Crashes (stops updating), until the end of the loop.
for the question what do i need such a code for : i don't. i have same error/case in a huge project i'm on, and this is just a code where i can make this error happens.
What's behind it ?
Thank you
start a new b4j project, add a TableView (designer), change the 'Sub Button1_Click' code :
B4X:
Sub Button1_Click
Dim i As Int
For i=1 To 105
If i Mod 2=0 Then
TableView1.SetColumns(Array As String("111","222"))
TableView1.SetColumnWidth(0,100)
TableView1.SetColumnWidth(1,100)
Else
TableView1.SetColumns(Array As String("RRR","MMM"))
TableView1.SetColumnWidth(0,200)
TableView1.SetColumnWidth(1,200)
End If
TableView1.Items.Clear
Dim lbl101 As Label
lbl101.Initialize("")
lbl101.Text="abc"
Dim lbl102 As Label
lbl102.Initialize("")
lbl102.Text="xyz"
TableView1.Items.Add(Array As Object(lbl101,lbl102))
Sleep(100)
Log(i)
Next
End Sub
run the program, click the button, watch the LOG.
the 1-105 loop is just to replace 105 button manuel clicks, each updating the table.
in my machine, after i=100, there's an error in the log. the Table Crashes (stops updating), until the end of the loop.
for the question what do i need such a code for : i don't. i have same error/case in a huge project i'm on, and this is just a code where i can make this error happens.
What's behind it ?
Thank you