Android Question How do to ACSearchview like Searchview

Miguelito

Member
Licensed User
Hi everybody, i don't know like program the control ACSearchview, i want to get the functionality of Searchview, like this code:

B4X:
Sub Process_Globals
    Dim index As Object
End Sub

Sub Globals
    Dim sv As SearchView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    sv.Initialize(Me, "sv")
    sv.AddToParent(Activity, 0, 0, 200dip, 300dip)
   
    If FirstTime Then
        Dim cities As List
        cities = File.ReadList(File.DirAssets, "Cities.txt")
        'As an optimization we store the index as a process global variable
        'and only build it once.
        index = sv.SetItems(cities)
    Else
        sv.SetIndex(index)
    End If
End Sub

Sub sv_ItemClick(Value As String)
    Msgbox("Chosen value: " & Value, "")
End Sub

I would appreciate your answers, please
 

bgsoft

Well-Known Member
Licensed User
Hello, I do not understand your question, if you use the Searchview class that is the code to work, but you have to add the SearchView.bas module to make it work.
You can download it here: https://www.b4x.com/android/forum/t...ul-alternative-to-autocompleteedittext.19379/

I have told you in the Spanish forum

regards

----------------------------------------------------------------------------------
Hola, no entiendo tu pregunta, si empleas la clase Searchview ese es el codigo para que funcione, pero tienes que añadir el modulo SearchView.bas para que funcione.
Te lo puedes bajar aqui: https://www.b4x.com/android/forum/t...ul-alternative-to-autocompleteedittext.19379/

Saludos
 
Upvote 0

Miguelito

Member
Licensed User
Hi bgsoft, it's mean, that I am using the ACSearchview library, but does not have the method sv.SetItems to list the names of the words to look for as if it has the Searchview library.

upload_2016-11-9_9-7-20-png.49882


I want to develop this functionality with ACSearchview. thanks a lot....
 
Upvote 0
Top