Android Question Missing row on table

Tim Chapman

Active Member
Licensed User
Longtime User
When I comment out the highlighted lines Lines 34-43, a line is not displayed on my table.
Any ideas?

Offending Sub!:
Sub AllTodos
    Log("AllTodos sub start")

    'Tapping on a cell with show its human readable value after looking it up if needed.
    'Long tap on a cell will allow user to change its value to those shown in a pull-down list.
    
    Table1Header(0) = HeaderRow(0) 'ID
    Table1Header(1) = HeaderRow(1) 'Task
    Table1Header(2) = HeaderRow(2) 'Status
    Table1Header(3) = HeaderRow(3) 'Context
    Table1Header(4) = HeaderRow(4) 'Category
    Table1Header(5) = HeaderRow(5) 'Priority
    Table1Header(6) = HeaderRow(6) 'Notes
    
    table1.SetHeader(Table1Header)

    'Log("TodoList.Size-1 = "&TodoList.Size)
    For i = 0 To Starter.TodoList.Size-1
        Dim Values(7) As String
        'Log("i = "&i)

        TempTodo.Initialize
        TempTodo = Starter.TodoList.Get(i)
        'Log("TempTodo = "&TempTodo)

        Values(0) = TempTodo.ID
        Values(1) = TempTodo.Name
        Values(2) = TempTodo.Status
        Values(3) = TempTodo.Context
        Values(4) = TempTodo.Category
        Values(5) = TempTodo.Priority
        Values(6) = TempTodo.Note

        'Test missing item.
        If i = 1 Then
            Log("TempTodo.ID = "&TempTodo.ID)
            Log("TempTodo.Name = "&TempTodo.Name)
            Log("TempTodo.Status = "&TempTodo.Status)
            Log("TempTodo.Context = "&TempTodo.Context)
            Log("TempTodo.Category = "&TempTodo.Category)
            Log("TempTodo.Priority = "&TempTodo.Priority)
            Log("TempTodo.Note = "&TempTodo.Note)
        End If

        table1.AddRow(Values)
    Next
    table1.SetColumnsWidths(Array As Int(0, 100%x - 15dip, 15dip, 0, 0, 0, 0))
End Sub
 

Attachments

  • Not Missing Line.jpg
    Not Missing Line.jpg
    230.9 KB · Views: 45
  • Missing Line.jpg
    Missing Line.jpg
    228.7 KB · Views: 47

klaus

Expert
Licensed User
Longtime User
I had a look at the problem.
It comes from this line:
B4X:
    table1.SetColumnsWidths(Array As Int(0, 100%x - 15dip, 15dip, 0, 0, 0, 0))
If you replace it by:
B4X:
    table1.SetColumnsWidths(Array As Int(1, 100%x - 15dip, 15dip, 1, 1, 1, 1))
Do not ask me why. I do not understand why this happens.
 
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
Interesting. I will try both solutions. You guys are wizards!. Thank you for the assistance. I have been studying and learned a ton about this programming language.
Could not do it without help. Some of this stuff is just not to be found anywhere else but by asking. Thanks again! I will post my results.
 
Upvote 0
Top