You can use this code to get the columns as they currently appear:
B4X:
Dim jo As JavaObject = TableView1
Dim columns As List = jo.RunMethodJO("getColumns", Null)
For Each column As JavaObject In columns
Log(column.RunMethod("getText", Null))
Next
Yes i am ok with your example - but i was talking about "number" of column and not the text-header becaues may be changed but from the other hand is simple to understand it.