Android Question How do I search for data in variable list?

bollanog

Member
Hello, good afternoon, how can I search for some data having a lot of data in a List type variable and then show the search in a CustomListView1

This is part of the code

B4X:
Private Sub Cargar
    ProgressDialogShow2("Cargando lista IP, Por favor espere...", False)
    Dim carga As HttpJob
    carga.Initialize("carga",Me)
    carga.Download(Main.URLS&"?ips=true&list=true")
    Wait For (carga) Jobdone(carga As HttpJob)
    If carga.Success Then
        Try
            Dim s As String = carga.GetString
            Dim root As Map = s.As(JSON).ToMap

            Dim data As List = root.Get("lis_ip")
            
            For Each m As Map In data
                CustomListView1.Add(CreateItem(CustomListView1.AsView.Width, m.Get("ip"), m.Get("mac"), m.Get("nombre"), m.Get("tipo"), m.Get("departamento"), m.Get("fecha")), m.Get("ip"))
            Next
            
            ProgressDialogHide
        Catch
            ProgressDialogHide
            Msgbox2Async("Error al procesar", "Aviso", "Aceptar", "", "", Null, False)
        End Try
    Else
        ProgressDialogHide
        Msgbox2Async("Error al cargar los datos, desea reintentar de nuevo?", "Aviso", "Reintentar", "Cancelar", "", Null, False)
        Wait For MsgBox_Result (iResult As Int)
        If iResult = DialogResponse.Positive Then
            Cargar
        End If
    End If
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…