hello, guys
I have a problem, I want a use Search View from sqlite database. how to do it and i am calling file.db complete but can't Query SQL for search, I very try but not work !!
help me please .
Thank you and sorry I'm speak English not good.
this my code some section.
I have a problem, I want a use Search View from sqlite database. how to do it and i am calling file.db complete but can't Query SQL for search, I very try but not work !!
help me please .
Thank you and sorry I'm speak English not good.
this my code some section.
B4X:
Sub Activity_Create(FirstTime As Boolean)
sv.Initialize(Me, "sv")
sv.AddToParent(Activity, 0, 0, 200dip, 300dip)
Dim cursor1 As Cursor
If FirstTime Then
'sql1.Initialize(File.DirDefaultExternal,".db",True)
If File.Exists(File.DirInternal, "lexitron.db") = False Then
'copy the default DB
File.Copy(File.DirAssets, "lexitron.db", File.DirInternal, "lexitron.db")
'if not, initialize it
sql1.Initialize(File.DirInternal, "lexitron.db", True)
'and create it
'CreateDataBase
'copy the default DB
File.Copy(File.DirAssets, "lexitron.db", File.DirInternal, "lexitron.db")
Else
'if yes, initialize it
sql1.Initialize(File.DirInternal, "lexitron.db", True)
End If
Dim cities As List
cursor1 = sql1.ExecQuery("SELECT esearch FROM eng2thai")
'cities = File.ReadList(File.DirAssets, "1.csv")
' cities = File.ReadList(File.DirAssets, "Cities.txt")
'As an optimization we store the index as a process global variable
'and only build it once.
cities.Add(cursor1.GetString("esearch"))
index = sv.SetItems(cities)
cursor1.Close
Else
sv.SetIndex(index)
End If
End Sub