1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question CustomListView Overflow?

Discussion in 'Android Questions' started by Binary Soft, May 16, 2019.

  1. Binary Soft

    Binary Soft Member Licensed User

    Hi,

    I use customlist view in my project.
    It's well done.
    But It shows the below error when table is more than 2000 rows.
    How can I fix it?

    art/runtime/indirect_reference_table.cc:121] JNI ERROR (app bug): weak global reference table overflow (max=51200)
    art/runtime/indirect_reference_table.cc:121] weak global reference table dump:
    art/runtime/indirect_reference_table.cc:121] please find table dump in dropbox: 11539-weak global reference-table-overflow-dump
     
    Last edited: May 16, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Binary Soft

    Binary Soft Member Licensed User

  4. Binary Soft

    Binary Soft Member Licensed User

    Hi,

    I use customlistview in my project with lazy loading. Loading speed is great.
    But It also same error after rows is over 12,500. This sample Rows is ten times of first project (before lazy loading).
    Is it customlistview max limit?
    I found max =51200 in bug report. max is row count?


    JNI ERROR (app bug): weak global reference table overflow (max=51200)

    Thanks
     

    Attached Files:

    Last edited: May 17, 2019
  5. Erel

    Erel Administrator Staff Member Licensed User

    No.
    There is no hard limit. It depends on the available memory and especially in the number of views created.

    Can you post the VisibleChanged code?
     
  6. Binary Soft

    Binary Soft Member Licensed User


    Code:
    Sub myListView_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
        
    Dim ExtraSize As Int = 20
        
    Dim n As Int = myListView.Size-1
        
    For i = 0 To n
            
    Dim p As B4XView = myListView.GetPanel(i)
            
    If i > FirstIndex - ExtraSize And i < LastIndex + ExtraSize Then
                
    'visible+
                If p.NumberOfViews = 0 Then
                    
    Dim iv As mySaleReportValue = myListView.GetValue(i)
                    p.LoadLayout(
    "2")
                    p.SetLayoutAnimated(
    0,0,0,100%x,40dip)
                    mySNo.Text = iv.mySNo
                    myVNo.Text = iv.myVNo
                    myName.Text = iv.myName
                    myDigit.Text= iv.myDigit
                    myUnit.Text=iv.myUnit
                    myRowID.Text= iv.myRowID
                    
    'Log("SNo: " & i  & " " &  iv.myDigit)
                End If
            
    Else
                
    'not visible
                If p.NumberOfViews > 0 Then
                    p.RemoveAllViews
                
    End If
            
    End If
        
    Next
    End Sub
    Erel,
    Now My sample records are only 11528 rows.
    I show error, records are more than 12000.

    Sample Project is send by message.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Your code looks correct. Do you really need to show more than 10k items? Users will never scroll 10k items. Check B4XTable. Let the user search for the relevant items.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice